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

Dear perl monks,
I have scripted a program using DBI & DBD to a mysql databse but unfortunately I will have to migrate this program to use a MS SQLServer. Is there any perl module to use with the DBI or any simple way out.

Thanks friends

Replies are listed 'Best First'.
(Ovid) Re: ms sqlserver
by Ovid (Cardinal) on Jan 18, 2002 at 22:55 UTC

    Three choices occur to me:

    1. DBD::ODBC
    2. DBD::ADO
    3. DBD::Sybase

    The first choice is the slowest, but it's convenient if you need to switch the database again. Just be sure to pore through your current code and find anything that is MySQL dependant.

    As for the last choice, I understand that it works with MS SQL Server, but I have never actually used it.

    Cheers,
    Ovid

    Update: It occurs to me that you might be using a *nix platform and have to connect to the database on the Win* platform. In that case, you can use DBD::Proxy.

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Re: ms sqlserver
by grep (Monsignor) on Jan 18, 2002 at 22:56 UTC
    It depends on the on the platform you are running from and the version of MS SqlServer.

    *nix Platform:
    FreeTDS
    DBD::Sybase V7 of Sql Server or below I believe


    Win32 Platform:
    WIN32::ODBC
    DBD::ODBC

    grep
    grep> cd pub
    grep> more beer
Re: ms sqlserver
by Moonie (Friar) on Jan 18, 2002 at 23:48 UTC
    You may want to look at this node.
    - Moon
Re: ms sqlserver
by tradez (Pilgrim) on Jan 18, 2002 at 23:32 UTC
    The beautiful thing about DBI is that with the installation of the MS SQLServer DBD, and with the correct connect() syntax. Most of your other code will not have to change. Once you have the correct $dbh, all of your prepare and execute logic shouldn't have to change. Although, depending on the level of the SQL, your SQL may have to updated because of different function calls between the two DML's.