1
2
my $DSN = 'driver={SQL Server};Server=IP;Database=DB;UID=user;PWD=pw';
$dbh = DBI->connect("DBI:ODBC:$DSN") or die "$DBI::errstr\n";
1
2
3
4
5
6
7
8
9
isql -v -s MSSQLServer <user> <pw>
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
1
2
DBI connect('MSSQLServer;Server=<ip>;Database=<dbname>;UID=<user>;PWD=<pw>','',...) failed: [unixODBC][Driver Manager]Data source name not found, and no default driver specified (SQL-IM002) at check_akcp_sensorprobe.pl line 358
[unixODBC][Driver Manager]Data source name not found, and no default driver specified (SQL-IM002)
1
2
3
4
5
6
7
[MSSQLServer]
Driver = FreeTDS
Description = DBTempServer sample database
Trace = No
Server = <ip>
Port = 1433
Database = <dbname>
1
2
3
4
[FreeTDS]
Description = v0.91 with protocol v8.0
Driver = /usr/lib64/libtdsodbc.so.0
UsageCount = 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[global]
# TDS protocol version
tds version = 4.2
# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
dump file = /tmp/freetds.log
debug flags = 0xffff
# Command and connection timeouts
timeout = 10
connect timeout = 10
# If you get out-of-memory errors, it may mean that your client
# is trying to allocate a huge buffer for a TEXT field.
# Try setting 'text size' to a more reasonable limit
text size = 64512
# A typical Sybase server
[egServer50]
host = symachine.domain.com
port = 5000
tds version = 5.0
# A typical Microsoft server
[<Dbname>]
host = ´<IP>
port = 1433
tds version = 7.0
1
2
my $DSN = 'driver={SQL Server};Server=IP;Database=DB;UID=user;PWD=pw';
$dbh = DBI->connect("DBI:ODBC:$DSN") or die "$DBI::errstr\n";
1
2
3
4
5
6
my $DSN = "DBI:ODBC:MSSQLServer";
my $UID = "<username";
my $PWD = "<pw>";
#Connect the database handle.
$dbh = DBI->connect($DSN,$UID,$PWD) or die "$DBI::errstr\n";