Monday, February 7, 2011

Flush the Cache of a Print Statement in SQL Management Studio

If you're using MS Management Studio.  If you want to debug a stored procedure or track the progress of a cursor, you can use print statements.  However, those print statements are cached in a buffer and are only flushed to the Message tab, when the buffer gets to a certain size. Unsure about the specific size.

This blog refers to this issue:
sql server - PRINT statement in T-SQL - Stack Overflow

The solution that worked for me very well using the RAISEERROR command as informational:

declare @print as Varchar(400)
Set @print = 'your message"
RAISERROR (@print,0,1) WITH nowait

Note this will not cause an error, but works exactly like the print statement with a few limitations.



Saturday, January 29, 2011

Key not valid for use in specified state. (Exception from HRESULT: 0x8009000B) (rsRPCError)

Rajesh has the answer, simple and to the point:

This error means that your Reporting Servers configuration for the Encryption key has been messed up. From the Reporting Server Configuration Manager you have to restore the encryption key. If you have lost it( it is always good to have a backup) then you may have to delete those databases(reportserver & reportservertempdb). Then you have to delete the reportserver and reports site on IIS. Then you have to start over the configuration again.

Got from his blog at:
Blog of Rajesh Meenrajan - MCSD.NET /MCTS SharePoint: Key not valid for use in specified state. (Exception from HRESULT: 0x8009000B) (rsRPCError)
Key not valid for use in specified state. (Exception from HRESULT: 0x8009000B) (rsRPCError)