Re: Database Engine Tuning Advisor suggestion to replace syntax.
- From: "Russell Fields" <russellfields@xxxxxxxxxx>
- Date: Sat, 30 Aug 2008 08:22:19 -0400
Thanks, Erland - RLF
"Erland Sommarskog" <esquel@xxxxxxxxxxxxx> wrote in message
news:Xns9B0A7496817BYazorman@xxxxxxxxxxxx
Russell Fields (RussellFields@xxxxxxxxxx) writes:
If that is true, Mike's code would benefit from reuse, but only if he
fully specified the table name. (Because the Books Online also comment
"If object names in the statement string are not fully qualified, the
execution plan is not reused.")
Which is not fully correct. The plan is reused, if the next guy has the
same default schema. But best practice is to use two-part notation with
sp_executesql.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000:
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- Database Engine Tuning Advisor suggestion to replace syntax.
- From: Mike
- Re: Database Engine Tuning Advisor suggestion to replace syntax.
- From: Erland Sommarskog
- Re: Database Engine Tuning Advisor suggestion to replace syntax.
- From: Russell Fields
- Re: Database Engine Tuning Advisor suggestion to replace syntax.
- From: Erland Sommarskog
- Database Engine Tuning Advisor suggestion to replace syntax.
- Prev by Date: Re: pcb out file datetime format
- Previous by thread: Re: Database Engine Tuning Advisor suggestion to replace syntax.
- Next by thread: SSMS 2008: Ctrl-Shift-M
- Index(es):
Relevant Pages
|