Writing to text files is probably redundant. You should look into using the MSSQL::DBlib and MSSQL::Sqllib modules (see also pm nodes here on MSSQL), FreeTDS (see also pm nodes here on FreeTDS)and use the methods contained therein.
You could also use raw ODBC methods through DBI with something like:
use strict;
use warnings;
use DBI;
my $dbuser = "foo";
my $dbpass = "bar";
my $dbname = "blort";
my $dbhost = "localhost";
my $dsn = "DBI:ODBC:database=$dbname;host=string";
my $dbh = DBI->connect($dsn, $dbuser, $dbpass, $dbhost
{RaiseError => 1});
# .. Execute your query on $dbh here, SELECT/INSERT/etc.
$dbh->disconnect;
(I initially read this and thought MySQL, and had included a good example snippet of code you could use, but then re-read it as MSSQL when I previewed it. I've never used MSSQL, so I updated my reply to be more helpful in this environment.) | [reply] [d/l] |
I just did this at our company. I used FreeTDS, DBI, and DBD::Sybase. Went rather smoothly. Didn't have to pay for any extra ODBC bridge stuff and made my boss happy:)
What version of MSSQL are you going to use? I'm only using 7.0 and I know the Sybase module works well up to this point. But I'm not sure about MSSQL 2000.
Also, if you decide to try FreeTDS you'll have to go through FreeTDS.org and get on the mailing list. It is very helpful.
peppiv
| [reply] |