views:

119

answers:

2

I have a print statement in a while loop of a stored procedure. The procedure updates around 20,000 records. The print statement should print out the primary key of each record but it does not display in the output window even though the procedure executes entirely and updates all the records. Is there some limit to the amount of data that can be put into the output window in sql server management studio?

+1  A: 

Are you perhaps printing a null somehow, and getting a pile of blank lines?

Oliver Townshend
This would be my guess because PRINT will always PRINT...
gbn
A: 

There is a limit to the number of characters displayed but it varies depending on if you're outputting the results to text or to a grid.

By default it's 256 characters per column for text results and 65535 characters for results sent to grid.

You can see the current settings by clicking on the Query menu and selecting Query Options... in SQL Server Management Studio.

Jason Towne