Instead of using
PRINT
use a feature of RAISEERROR called
NOWAIT
e.g.
RAISERROR 'File Processing Stated ' + Str(@Cnt), 0, 1) WITH NOWAIT
Using the
0
means that sql treats the "error" like a straightforward message.
These links give more details
http://www.mssqltips.com/sqlservertip/1660/using-the-nowait-option-with-the-sql-server-raiserror-statement/[
^]
http://msdn.microsoft.com/en-us/library/ms178592.aspx[
^]
http://www.sommarskog.se/error-handling-I.html[
^]
[Edit] - Another technique I've used in the past is to have a "logging table" on the same database ... in this instance replace the
print
with
insert into logtable values('File Processing Started' + Str(@Cnt))
- and consider either clearing the table down each time or using having timestamp column autogenerated