Tuesday, 23 April 2013

Get sql server execution plan

You can get the execution plan for queries in SQL server using the following script. This will display the execution plan and not run the script, so you wont need any data in the db in order to get the execution plan.

set showplan_all on
go
set noexec on
go
-- query to test
select * from sysobjects
-- end of query to test 
go
set noexec off
go
set showplan_all off
go

No comments:

Post a Comment