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

Hi Monks!

I have to access a MSSQL Server 2k on a Win 2k box from a linux server, probably using ODBC. I did some research through Super Search, deja, google etc. but I'm still not sure I get it right. I have no access to the Windows box yet, so just some theoretical questions now:
  1. Are there any ways to access the MSSQL server without installing any additional software on the server (i.e. windows) side and without using another windows server that acts as some kind of bridge? The freetds/DBD::Sybase approach maybe?
  2. Any experience with a similiar problem? Especially concerning MSSQL Server 2000?
My first - and hopefully my last - windows question here :)
snowcrash (now heading for the book shop in order to buy the cheetah book)
  • Comment on ODBC from Linux to Windows 2000 / MSSQL

Replies are listed 'Best First'.
Re: ODBC from Linux to Windows 2000 / MSSQL
by busunsl (Vicar) on May 15, 2001 at 14:22 UTC
    The freetds/DBD::Sybase should work, though I don't know how far the freetds project has come to implement the protocol.

    Another approach might be to use ODBC on Linux and DBD::ODBC.
    I know, there are several implementations of ODBC in Linux, but I don't know any by name.

    Update: Have a look at the documentation of DBD::ODBC, Your question may be answered there.

Re: ODBC from Linux to Windows 2000 / MSSQL
by asiufy (Monk) on May 15, 2001 at 15:58 UTC
    If you don't want to install anything on the server, you'll need either FreeTDS or the Sybase libraries.

    FreeTDS is not mature enough for heavy duty production use, but for light stuff it works. Please check their site for more info. Compile that, and you'll be able to use DBD::Sybase normally. Notice that, for SQL Server 2000, I believe you'll have to compile/use FreeTDS with version 4.2 of the protocol.

    The other option (Linux-only) is the Sybase libraries. I can't remember the exact location of those, but I'm sure Google will help you... Those are statical libraries (no source code provided, so watch for the system configuration requirements), and DBD::Sybase will work on top of those too.
Re: ODBC from Linux to Windows 2000 / MSSQL
by MrCromeDome (Deacon) on May 15, 2001 at 17:13 UTC
    Can you install anything on the Linux side? If so, you might have a couple of options. Check out the UnixODBC project or the ODBC bridge software available from EasySoft. I haven't tried either, personally, but there might be something there that helps.

    Once you have established a connection, DBD::ODBC works great. I have used it on a number of occasions to tie perl scripts to MSSQL databases. Granted, web server (Apache) was also running on Windoze.

Re: ODBC from Linux to Windows 2000 / MSSQL
by blue_cowdawg (Monsignor) on May 15, 2001 at 23:31 UTC

    From my experiences at Lehman Brothers I found that the DBD::Sybase approach worked very well.

    One of the in-house applications that I was responsible for maintaining took data from both Sybase databases and SQL Server to do all sorts of reporting. Everyone assumed (myself included until I was told) that all the data lived on Sybase. The stuff were were pulling from SQL Server was generated by SMS.

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Peter L. Berghold --- Peter@Berghold.Net "Those who fail to learn from history are condemned to repeat it."