DBD::ADO not returning error message

From: Tommy (ziggy.696040_at_bloglines.com)
Date: 09/27/04


Date: 27 Sep 2004 12:00:53 -0700

I'm using DBD::ADO 2.92 with DBI 1.37 accessing a SQL Server 2000
database. When I attempt to restore a log for a standby database
while the database is in use, I get the following error in SQL Query
Analyzer:

Server: Msg 3101, Level 16, State 2, Line 1
Exclusive access could not be obtained because the database is in use.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE LOG is terminating abnormally.

But when I try this from a perl script, the command fails, but I get
no error returned. Here's how I'm executing it:

$dbh->do("restore log tdw_standby from
disk='c:/logs/tdw_20040927132933.TRN' with norecovery");
print "dberr=$dbh->{err}\nerrstr=$dbh->{errstr}\n";

The $dbh->err and $dbh->errstr are both empty. I get the same results
if I use prepare and execute with a statement handle.

Am I doing something wrong?

Thanks,

Tommy



Relevant Pages

  • Re: SQL 2000 SP4 on 2003 Server - Single User Mode
    ... I found the section where you list the filename to restore to. ... rename the SQL Server the same as what is listed below Courthouse? ... Once you've created your database (simply right click on the Database ...
    (microsoft.public.sqlserver.setup)
  • Re: Moving databases from SQL 7 to SQL 2000 - More Questions!
    ... want to run sp_updatestats after the restore or attach as well. ... >>There is a lot more that can go wrong with the wizard ... > SQL Server Databases ... >>Issues When a Database Is Moved Between SQL Servers ...
    (microsoft.public.sqlserver.setup)
  • Re: Restore Master DB to New Server
    ... the user database will be suspect. ... Just drop them and then do the restore. ... Tibor Karaszi, SQL Server MVP ...
    (microsoft.public.sqlserver.tools)
  • Re: HELP!!! restore database - left in loading state?? PLEASE H
    ... RESTORE DATABASE WITH RECOVERY ... Columnist, SQL Server Professional ...
    (microsoft.public.sqlserver.tools)
  • Re: Migration ?
    ... I've tried every way I can think of trying to restore the master database. ... Will a restore on the SQL ... Install a SQL Server failover cluster instance ...
    (microsoft.public.sqlserver.clustering)