November 3, 2008 at 2:18 pm
1. Static query: (Clustered Index Seek cost is 100% - estimated execution plan)
Select * from tblContract_Instal1
where Contract_No = 4669
2. Dynamic query: (Clustered Index Seek cost not shown - estimated execution plan)
exec ('Select * from tblContract_Instal1
where Contract_No = 4669')
Question:
1. Why is the Clustered Index Seek cost not shown in no.2
2. Can anyone give me more examples of Dynamic queries.
Regards
Kevin
November 3, 2008 at 8:08 pm
clive (11/3/2008)
1. Static query: (Clustered Index Seek cost is 100% - estimated execution plan)Select * from tblContract_Instal1
where Contract_No = 4669
2. Dynamic query: (Clustered Index Seek cost not shown - estimated execution plan)
exec ('Select * from tblContract_Instal1
where Contract_No = 4669')
Question:
1. Why is the Clustered Index Seek cost not shown in no.2
2. Can anyone give me more examples of Dynamic queries.
Regards
Kevin
Have you tried the Actual Execution Plan? The reason why the Clustered Index Seek was not shown in #2 is because dynamic SQL is not evaluated in estimated execution plans because it doesn't exist as anything that get's executed until it's actually executed.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply