|
/Admin/databases/MSSQL:
Connecting to MS SQL Server from Linux
This reference was MOST helpful:[1]
apt-get install sqsh freetds-bin freetds-common
Edit /etc/freetds/freetds.conf and add something like this to the end:
[MServer]
host = msuckserver
port = 1433
tds version = 8.0
Edit ~/.sqshrc to contain this:
\set username=msqlloginname \set password=msqlloginpassword \set database=msqldbname \set style=vert
For the case of only one database, it seems to be sufficient to delete the above database=msqldbname line from ~/.sqshrc. And then connect as follows:
sqsh -SMServerFiguring out what to do next is a bit tricky. This will get the list of tables:
sp_tables;And this will get the table contents:
go
select * from tablename;
go
[1] http://www.foscode.com/connect-microsoftsql-server-from-linux/
posted at: 02:56 | path: /Admin/databases/MSSQL | permanent link to this entry