Tuesday, 30 October 2012

TSQL Performance Tuning

 

Below is an example of the TSQL you can use to investigate your stored procedure's performance. Best to put this in a snippet if you're using VS 2012 or greater versions of SQL Management Studio I find.

SET NOCOUNT ON

DBCC FREEPROCCACHE

DBCC DROPCLEANBUFFERS

CHECKPOINT

GO

PRINT ' '

PRINT '-- START: ProcName --------------------------------------------------------------------------------------------------------------------------------'

PRINT ' '

SET STATISTICS IO ON

SET STATISTICS TIME ON

EXEC dbo.MyProcNameHere

SET STATISTICS TIME OFF

SET STATISTICS IO OFF

PRINT ' '

PRINT '-- END: ProcName --------------------------------------------------------------------------------------------------------------------------------'

PRINT ' '

GO

No comments:

Post a Comment

How to replace the watch battery in Logitech K750 solar power keyboard

Buy this battery http://www.watchbattery.co.uk/shop/products/BB-ML2032.shtml Open the battery cover on the back of the keyboard, you’ll need...