Re: Database Engine Tuning Advisor suggestion to replace syntax.



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

.



Relevant Pages

  • Re: query performance help needed
    ... I created a SP that by using dynamic sql access SP in all databases ... The stored procedure in other databases is very simple couple of joins ... Not really sure what you mean when you say "the execution plan is ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • Re: Ad-hoc/Dynamic SQL Performance
    ... that, on the same hardware, Oracle 10 is about 20% slower than SQL Server. ... execution plan and bind that execution plan with the COBOL program. ...
    (comp.databases.oracle.server)
  • Re: Database Engine Tuning Advisor suggestion to replace syntax.
    ... execution plan is not reused.") ... Links for SQL Server Books Online: ...
    (microsoft.public.sqlserver.tools)
  • Re: SQL Server Management Studio cant see the 2005 engine?? But can see 2000 ?!?
    ... contains the databases that I had previously defined in SQL Server 2000. ... Installation Wizard" it says that I've got a higher version and cannot ... Just pick "Server components, tools, Books Online and samples" ...
    (comp.databases.ms-sqlserver)
  • Re: recent drivel posted by Tony Rogerson on his blog
    ... to respond to a blog. ... You accept what you are used to as the norm, msdn is slow which is why I have books online installed locally, it has a link on the search through to the online version anyway - also out to a number of community sites my own included. ... Tony Rogerson, SQL Server MVP ... [UK SQL User Community] ...
    (comp.databases.oracle.server)

Loading