Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

SQL Server freeTDS walkthrough?

by Anonymous Monk
on Sep 13, 2002 at 14:43 UTC ( #197601=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi - I've got solaris running with mySQL on it. I want to push some of the data from this box to a remote WinNT box running SQL Server 7 with PERL CGI scripts from a website running on the Solaris box. I've found that freeTDS is one of the suggested ways to go about it. Are there any step by step walkthroughs available? Detailing installing the software/drivers, then interfacing with freeTDS through DBI or DBD?

Replies are listed 'Best First'.
Re: SQL Server freeTDS walkthrough?
by RMGir (Prior) on Sep 13, 2002 at 14:51 UTC
    I think the directions on the website are pretty good.

    I've gotten it working with SQL Server 2000 without too many problems.

    I used the

    try server login = yes try domain login = no
    options. I'm not sure domain login would work. You have to add a section for your server to the freetds.conf file; the docs on that are pretty clear.

    One thing to note is that if tables don't belong to the sa user, you have to reference them as user.table, or you get VERY uninformative error messages.

    Apart from that, DBD::Sybase works just fine.

Re: SQL Server freeTDS walkthrough?
by joe++ (Friar) on Sep 13, 2002 at 15:06 UTC

    I had a solution working two years ago, with Perl on Solaris 2.6 (Sun SPARC) and SQL-Server 7 on WinNT 4.

    Back then I wrote the following documentation:

    MS SQL-Server (NT) to Perl (Solaris)


    • Perl interface for MS-SQL-Server
    • Perl is running on the local Sun (Solaris) machine
    • SQL Server is hosted on a remote Windows NT box

      Thanks for the steps. I pretty much followed through with those. And then tried to use the (saved as CGI and run from my solaris website.

      Here's the test.cgi code:

      #!/usr/local/bin/perl # use DBI; my $dbh = DBI->connect("dbi:Sybase:server=JDBC", 'guest', 'sybase', {P +rintError => 0}); die "Unable for connect to server $DBI::errstr" unless $dbh; my $rc; my $sth; $sth = $dbh->prepare("select \@\@servername"); if($sth->execute) { while(@dat = $sth->fetchrow) { print "@dat\n"; } }

      And here's the error I got:

      install_driver(Sybase) failed: Can't continue after import errors at / +usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBD/ line 9 +2 BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +6.1/sun4-solaris/DBD/ line 92. Compilation failed in require at (eval 626) line 3.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://197601]
Approved by RMGir
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2018-06-24 20:20 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.