Showing posts with label statements. Show all posts
Showing posts with label statements. Show all posts

Sunday, March 11, 2012

Displaying print statements of Stored Procedures in SSIS Logs

Hi

I have few print statements in a stored procedure that gets called from the SSIS package. How do I make sure that these are captured in the SSIS log meaning how do I get them to be displayed in the Package Explorer window when running from the Business Intelligence Studio IDE.

Not possible. Print statements are diagnostic in nature and are not part of the returned data set, which is what gets exposed to SSIS.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1229612&SiteID=1

Displaying Print Debugging from Stored Procedure immediately

I am attempting to debug a very long stored procedure, for this I inserted many print statements at key points on the procedure, but I find that once I do an exec sp_name I only get the print statements show in the message tab only after the full execution or cancellation of the stored procedure.

Is there any way to force the message tab to display the messages mid execution?

One way is to use the raiserror command with a severity of 10 and a "with nowait" option. This will not cause an actual error to be raised, as you can see by running this code:

begin try

raiserror('Progress message', 10, 1) with nowait

end try

begin catch

print 'here'

end catch

Ron Rice