mssql-cmd - SQL Server interactive and batch query command-line tool »
Download mssql-cmd Free Trial »
In interactive mode:
mssql-cmd> connect username:password@host:port/dbname;
example:
mssql-cmd> connect pan:withdata@192.168.0.102:1433/master
In batch mode:
mssql-cmd dsn="username:password@host:port/dbname"
example:
mssql-cmd dsn="pan:withdata@192.168.0.102:1433/master"
If you want to hide password
In interactive mode:
mssql-cmd> connect username@host:port/dbname;
example:
mssql-cmd> connect pan@192.168.0.102:1433/master
In batch mode:
mssql-cmd dsn="username@host:port/dbname"
example:
mssql-cmd dsn="pan@192.168.0.102:1433/master"
Disconnect from SQL Server:
mssql-cmd> disconnect;