Wednesday 10 September 2008

SQL Messages Window : Get Messages straight away!

If you use PRINT to pass status messages back when running a TSQL script, you typically dont get to see them until the script completes (or errors) and then, they appear all at once (not great for debugging...)
DECLARE @StatusMessage varchar (100)
SET @StatusMessage = 'Insert Finished, Update Starting : ' + CONVERT (CHAR (20), GETDATE (), 8)
RAISERROR (@StatusMessage , 10, 1) WITH NOWAIT 


http://sqlblogcasts.com/blogs/leopasta/archive/2007/07/03/instant-gratification.aspx

No comments: