> From: Janet Goldstein <[EMAIL PROTECTED]> > Date: 2004/07/13 Tue PM 02:00:09 GMT > > Am I missing something? I searched CPAN for a DBI driver for Microsoft > SQL Server and found only "DBIx::SQLEngine::Driver::MSSQL - Support > DBD::ODBC with Microsoft SQL Server." Is there nothing out there for > SQL Server as there is for Oracle (DBD::Oracle)? Must I go through > ODBC to talk to a SQL Server database?
I have been writing a script that connects to multiple sources, and use this to determine which driver to use, and detect whether or not it is available.... The ODBC for MSSQL (from a Windows 2000 client) has been working quite well for me, including dropping/creating/altering tables, columns, indices; granting permissions, dropping/adding roles, logins, and users... ############################################################################### # Check to see if the proper database module is available sub CheckAvail { my $retval = 1; if ("\U$arg_db_type\E" eq "ORACLE") { eval "use DBD::Oracle"; if ($@) { $retval = 0; } } elsif ("\U$arg_db_type\E" eq "SYBASE") { eval "use DBD::Sybase"; if ($@) { $retval = 0; } }elsif ("\U$arg_db_type\E" eq "MSSQL") { eval "use DBD::ODBC"; if ($@) { $retval = 0; } }elsif (("\U$arg_db_type\E" eq "ACCESS97") or ("\U$arg_db_type\E" eq "ACCESS2K")) { eval "use DBD::ADO"; if ($@) { $retval = 0; } } if (! $retval) { print LOGFILE "The module for this database could not be loaded; failing....\n" } return $retval; } ############################################################################### HTH, amonotod -- `\|||/ amonotod@ | subject line: (@@) charter.net | no perl, no read... ooO_(_)_Ooo________________________________ _____|_____|_____|_____|_____|_____|_____|_____|