Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to capture PRINT statement from stored procedure? 1

Status
Not open for further replies.

dklions

Programmer
Jul 20, 2001
7
US
Hi,
how can I capture PRINT statements from my stored procedure in Visual Basic (SQL Server 2000/VB6)?
I'm using ADODB.Command object.

I have a set of stored procedures that have a bunch of print statements in them. I need to capture those statements into the LOG FILE.


Please Help!

Thanks!
 
Throught the infomessages event of the Connection object.

Just be aware that if you are using SQLOLEDB you can only ever get one back, if you use MSDASQL (odbc) you get them all back.

Oh yeah.. Connection must be declared withevents and it is the info message event of the connection that you need to trap on.

Rob


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top