sub DBCC { my $database = shift(); my $text = ''; my $dbh = DBI->connect('dbi:ODBC:jobodbc2', 'xxxx', 'xxxx', {PrintError => 0,RaiseError => 1,LongReadLen => 65536, odbc_async_exec => 1, odbc_err_handler => sub { my ($state, $msg) = @_; # Strip out all of the driver ID stuff $msg =~ s/^(\[[\w\s]*\])+//; $text .= $msg."\n"; return 0; } }); my $sth = $dbh->prepare("dbcc CHECKDB ('$database')"); $sth->execute; $dbh->disconnect(); return $text; } #### DBD::ODBC::st execute failed: (DBD: dbd_describe/SQLNumResultCols err=-1)