Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using bash script to connect to remote SQL Server

Our company has a db (SQL Server) in another country. I have the host name, username and the password of the db. I want to extract data from the database through bash shell and put them into local file. How can I do that?

like image 474
TrueBlue10 Avatar asked Sep 14 '25 18:09

TrueBlue10


1 Answers

Install FreeTDS. Once configured you'll be able to use tsql to query SQL Server from bash.

like image 58
Liam Gretton Avatar answered Sep 16 '25 09:09

Liam Gretton