> > Query 1 > ======== > > Is it possible to use Perl DBI to connect to SQL Server? > I think all DBD drivers (mysql,Oracle,etc) need different syntax for > connect. > > Supposing I want to connect to database runnnig at 10.0.0.1 port 1433 and > schema name is "schema1" username and password to connect to database is > "user" and "pass". > > my $dbh = DBI->connect(**what is the syntax to write the string here??**) > || die $DBI::errstr;
I've been using DBD::ODBC to connect to SQL Server 2005. The only problem I've had is with the bind_param_inout_array method. That method does not seem to be implemented in DBD::ODBC 1.17. my $dsn = 'schema1'; my $dbuser = 'user'; my $dbpass = 'pass'; my $dbh = DBI->connect("dbi:ODBC:$dsn", $dbuser, $dbpass) or die "$DBI::errstr\n"; You would need to create the ODBC connection to 'schema1' using the Data Sources administration tool. - Mike