tags:

views:

22

answers:

1

I'm running some scripts on a database programmatically. The script produces 'light' errors like so:

RAISERROR (N'[dbo].[TheTableName]: Inserted ACME information: 1.....Done!'
   , 10, 1) WITH NOWAIT;

Redgate-generated scripts seem to generate a lot of these. They're actually helpful with what I'm doing, so I'd like to capture them and show them to the user. But I'm pretty sure they get swallowed up when you run the script via .NET. Is that correct?

+1  A: 

The messages are events on the connection; look at SqlConnection.InfoMessage, or the example here.

Marc Gravell
exactly what I needed, thanks!
jcollum