use warnings; use strict; use DBI; my $usr = ''; my $psw = ''; my $dsn = 'dbi:ODBC:Driver={SQL Server};;Database=master;Trusted_Connection=yes'; my $dbh = DBI->connect($dsn, $usr, $psw, { RaiseError => 1 }); my $cmd = q(select 'one';select 'two';select 'three';); my $sth = $dbh->prepare($cmd); $sth->execute(); while (my @data = $sth->fetchrow_array) { print "@data\n"; } $sth->finish;