Getting the plan handle for a sproc

You can use this T-SQL to get the plan handle for a sproc that has a bad execution plan:

Make sure, to…

Viewing the execution plan for a specific Sproc

Views – 697

Using UPDATE STATISTICS

Updates query optimization statistics on a table or indexed view. By default, the query optimizer already updates statistics as necessary to improve the…

T-SQL Basic Command Examples

Some of these snippets are useful when scripting schema changes, as opposed to using the GUI tools. For example, we have several instances…