Results 1 to 2 of 2
  1. #1
    Join Date
    May 2007

    Unanswered: ActivePerl, DBI and SQL Server 2005

    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:

    use DBI;
    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.

    What do ya'll suggest?



  2. #2
    Join Date
    Oct 2002
    Baghdad, Iraq
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts