Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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?

Comment on SQL Server freeTDS walkthrough?
Re: SQL Server freeTDS walkthrough?
by RMGir (Prior) on Sep 13, 2002 at 14:51 UTC
    I think the directions on the http://www.freetds.org 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.
    --
    Mike

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

    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)

    Setup:

    • 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 test.pl (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/Sybase.pm line 9 +2 BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +6.1/sun4-solaris/DBD/Sybase.pm line 92. Compilation failed in require at (eval 626) line 3.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://197601]
Approved by RMGir
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (13)
As of 2014-08-22 18:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (163 votes), past polls