How to test connectivity to a Microsoft SQL database using the Linux command line

Here are some useful commands when working with Microsoft SQL and Linux, specifically pertaining to the sqlcmd utility.

Testing Connectivity

sqlcmd -S user.database.windows.net -U db_user -P db_password

View all Databases

1> select name from sys.databases
2> go

Select Records

1> select top 10 * from table_name order by id desc
2> go


Share this article

Share on facebook
Share on twitter
Share on linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top