Environment:
Ubuntu12.10 _ x64
Problem:
Use tsql to access SQL Server
>> tsql -H 192.168.88.133 -p 1433 U saError 20002 (severity 9):Adaptive Server connection failed
Solution:
View the TDS version
>> tsql -CCompile-time settings (established with the "configure" script) Version: freetds v0.91 freetds.conf directory: /usr/local/freetds/etc MS db-lib source compatibility: yes Sybase binary compatibility: no Thread safety: yes iconv library: yes TDS version: 7.1 iODBC: no unixodbc: yes SSPI "trusted" logins: no Kerberos: no
View freetds. conf file
>> vim /usr/local/freetds/etc/freetds.conf
Add the corresponding version information
# A typical Microsoft server[egServer71] host = ntmachine.domain.com port = 1433 tds version = 7.1
View data source files
>> vim /etc/tds.datasource.template
Modify tds_version
TDS_Version = 7.1
View ODBC. ini file
>> vim /etc/odbc.ini
Modify tds_version
TDS_Version = 7.1
Note:There may be more than one solution to this problem. LZ has not yet figured out the root cause of the problem, but has solved the problem through the above methods. LZ will work harder to find out the cause of the problem and will update it later.