Sunday, August 20, 2017

Install sqlcmd and bcp the SQL Server command-line tools on Linux (centos 7.3)

Followed

Install sqlcmd and bcp the SQL Server command-line tools on Linux

 

tested okay from centos7.3 to sql server express 2014 running on windows 10.

[oracle@hmc-P55A-UD3 bin]$ ls -l
total 752
-rwxr-xr-x. 1 root root 239320 May  9 15:09 bcp
-rwxr-xr-x. 1 root root 525856 May  9 15:09 sqlcmd
[oracle@hmc-P55A-UD3 bin]$ pwd
/opt/mssql-tools/bin

[oracle@hmc-P55A-UD3 ~]$ sqlcmd -U perfstat  -S 192.168.0.181,1433
Password:
1> select count(*) from sys.sql_logins;
2> go;
3> go
Msg 102, Level 15, State 1, Server MP04ISLLIQY1\SQLEXPRESS, Line 2
Incorrect syntax near 'go'.
1> select count(*) from sys.sql_logins;
2> go
          
-----------
          4

(1 rows affected)