in reply to Re: DBI+MS SQL, capture prints from stored procedures
in thread DBI+MS SQL, capture prints from stored procedures

Nope. DBCC CHECKDB ... is a builtin statement of MS SQL Server used to check the status of a database, while the dbo.dbAdm_Daily is a stored procedure and stored procedures should be executed using the EXEC keyword (you do not have to use the EXEC, but only if the procedure call is the very first statement in a batch.

I just tried to call the procedure without the EXEC ... did not make any difference.

In either case both the commands work just fine in Query Analyzer, both execute using $dbh->do(...), but I have to use the prepare+execute to be able to capture the messages and that only works for the DBCC command. God only knows why :-(

Replies are listed 'Best First'.
Re^3: DBI+MS SQL, capture prints from stored procedures
by meredith (Friar) on Apr 27, 2006 at 03:59 UTC

    Just a guess.. Does that SP only print and not return data? Maybe DBI doesn't currently behave correctly under those conditions and you need to return a 1x1 result.

    mhoward - at - hattmoward.org