I'm trying to connect to our SQL Server DB through Perl using DBI. I tried searching through this forum for some clues, but only found a couple things that were from 2003. So I thought I would ask again. Here's what I've got:
my $dsn = "DBI:mysql:database=DatabaseName";
my $username = 'something';
my $auth = 'something here';
my $dbh = DBI->connect($dsn, $username, $auth);
I'm guessing I can't use MySQL to connect. ha. I couldn't find anything in the perl package manager for DBI specifically for SQL Server.
SQL Server uses Tabular Data Stream, which is essentially the same network protocol as Sybase uses. Thus, for the most native connection, you need the DBD:ybase module, in particular see the notes on using it with SQL Server. There are two TDS libraries available, FreeTDS or Sybase's libraries.
Other options are Active Data Object or ODBC. ODBC is more of a generic standard; as I understand ADO is MS's latest and greatest. Personally have a look at what limitations each driver has, on CPAN you can see all the revisions and get an idea how mature each is. But most of all, find out which one is the easiest to get running with.