If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Perl and the DBI > ActivePerl, DBI and SQL Server 2005

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-30-07, 17:42
balikian balikian is offline
Registered User
 
Join Date: May 2007
Posts: 1
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?

thanks!

scott
Reply With Quote
  #2 (permalink)  
Old 07-02-07, 23:29
sco08y sco08y is offline
Registered User
 
Join Date: Oct 2002
Location: Baghdad, Iraq
Posts: 697
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On