I recently worked from perl on Linux with a MS SQL server database, and got the best results with FreeTDS:
my $dbh = DBI->connect ("dbi:ODBC:mssql_freetds", $username, $password
+, \%dbi_attributes);
$ cat ~/.odbc.ini
[mssql_freetds]
Description = My MS SQL database
Driver = FreeTDS
TDS version = 7.2
Trace = No
Server = mysql.server.local
Port = 1433
Database = DatabaseName
User = UserName
Password = PassWord
Client Charset = UTF-8
The biggest difference between FreeTDS and the MS ODBC driver is the return type of UUID field. The MS ODBC does not allow nested queries, whereas the FreeTDS driver does. So I used the ODBC driver to make a CSV dump of the database and the FreeTDS driver to actually work with the database.
For ODBC I did
my $dbh = DBI->connect ("dbi:ODBC:mssql_odbc", $username, $password, \
+%dbi_attributes);
$ cat ~/.odbc.ini
[mssql_odbc]
Description = My MS SQL database
Driver = ODBC Driver 17 for SQL Server
Server = mysql.server.local
Database = DatabaseName
User = UserName
Password = PassWord
Also make sure you put the fully qualified hostname in the server name. localhost will not work.
Enjoy, Have FUN! H.Merijn
|