in reply to Importing text files with DBI

Something like this could work, assuming a single SQL statememt per file:
use strict; my $dbh = DBI->connect('dbi:...', 'user', 'pwd'); foreach my $file (@ARGV) { open(IN, $file) || die "Can't open $file: $!"; my $sql = join(' ', <IN>); close(IN); my $sth = $dbh->prepare($sql); $sth->execute() || die $sth->errstr; # Maybe you need to fetch rows here? while(my $d = $sth->fetch) { print "@$d\n"; } }
The above is obviously very minimal (and untested) - and it you have more than one SQL statement per file you need to figure out a way to break the file into SQL statements.

Of course you could also simply use MS-SQL's isql.exec command-line tool to run the statements...

Michael