williamd has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to connect to a MS-SQL Server on an NT box obviously and I've read a lot of stuff a lot of which makes me think that it cannot be done. I'm running Perl5 on a Linux and want to connect to the MS-SQL server from this machine. I've read a lot about DBD::ODBC and using the DBI, of which I have experience with MySQL and mSQL, but I haven't read anything that is too convincing. Has anyone out there had any success with this? Also does anyone know how to change your password with perlmonks? thanks.
  • Comment on Connecting to MS-SQL Server using Perl on a Linux box.

Replies are listed 'Best First'.
Re: Connecting to MS-SQL Server using Perl on a Linux box.
by PsychoSpunk (Hermit) on Jan 05, 2001 at 03:55 UTC
    Fear not, for it can be done. First question, of course, is the version of MS SQL since this will be the deciding factor.

    If you have 6.5, then you have nothing to fear at all. Use DBD::Sybase with the free CTLibs and all is well.

    7.0 is the real test of any monk. I am currently doing okay with DBD::ODBC and drivers from OpenLink Software. As noted in Re: Re: Re: Perl to MS Access with DBI:ODBC on Unix, you may run into a memory leak. I don't have hard numbers that demonstrate how fast this leak occurs, but TStanley mentioned Merant as an alternative. (Sorry, I don't have that URL). I also can't seem to find the node I want to link where I've got more information. I'll update this once I find it so I don't have to go through the whole rigamarole again.

    ALL HAIL BRAK!!!

      Merant can be found here

      TStanley
      There can be only one!
Re: Connecting to MS-SQL Server using Perl on a Linux box.
by lemming (Priest) on Jan 05, 2001 at 03:44 UTC
Re: Connecting to MS-SQL Server using Perl on a Linux box.
by extremely (Priest) on Jan 05, 2001 at 04:44 UTC
    I do this every day by installing the sybase drivers from sybase and DBD::Sybase. MSSQL is originally a offshoot of Sybase (4?) and still shared the basic protocol to this day. You will have to forgo CPAN's automated install and make the DBD part yourself since the 'make' part will fail if you don't manually add '-linsck' in the CONFIG file (and likely you should either tell it where the libs are in there too or restart after adding the SYBASE= environment variable to the default for the users who will compile/use sybase libs) Also the 'make test' part will fail if you don't put a fairly powerful user/password in the PWD file. Mail me if you need help.

    Also, you can change your own password on here by clicking on your own name here: williamd and then picking Edit at the bottom of the page. If I've got it sussed correctly, clicking on Edit there should get you to the password change page as well.

    --
    $you = new YOU;
    honk() if $you->love(perl)

Re: Connecting to MS-SQL Server using Perl on a Linux box.
by davorg (Chancellor) on Jan 05, 2001 at 03:44 UTC

    Given that MS-SQL Server and Sybase SQL Server were once the same product, you may have some success using the DBD::Sybase module (as long as you don't need to do anything too clever).

    --
    <http://www.dave.org.uk>

    "Perl makes the fun jobs fun
    and the boring jobs bearable" - me

      I had limited success doing this. (Read: I could make a connection after jumping through flaming hoops and applying service patches to MS SQL Server and bandages to my bruised skull.)

      ALL HAIL BRAK!!!

Re: Connecting to MS-SQL Server using Perl on a Linux box.
by wardk (Deacon) on Jan 05, 2001 at 03:55 UTC
    You will certainly need ODBC drivers for Linux, but I don't know how available such a thing is. It likely will be something you have to purchase.

    I found this link: Linux, ODBC and MS SQL Server 7 that speaks to the issue. There are a number of helpful followups to this link...

    Good luck and report back any success!

    UPDATEHere is an attempt at a Free TDS FreeTDS specifically to address this issue. Appears to be "Free as in Beer".