Database Engine Tuning Advisor suggestion to replace syntax.
- From: Mike <mssql@xxxxxxxxxxxxx>
- Date: Thu, 28 Aug 2008 09:20:01 -0700
SQL Server 2005 Database Engine Tuning Advisor informs me that I should
replace query 1 below with the syntax in query 2 below. I’m just not seeing
the reason since both the “SELECT” statements optimization plans are stored
for reuse. Am I missing something?
Mike.
Query 1
EXEC sp_executesql N'SELECT FirstName, LastName, Company, StreetAddress,
City, State, ZIP5, ZIP4
FROM Customers
WHERE City = @P1
AND State = @P2',
N'@P1 char(32), @P2 varchar(32)', 'Poedunk', 'Iowa'
Query 2
DECLARE @P1 varchar(32)
DECLARE @P2 varchar(32)
SET @P1 = 'Poedunk'
SET @P2 = 'Iowa'
SELECT FirstName, LastName, Company, StreetAddress, City, State, ZIP5, ZIP4
FROM Customers
WHERE City = @P1
AND State = @P2
.
- Follow-Ups:
- 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.
- Prev by Date: Re: Can I create a Scipt with only create index command?
- Next by Date: Re: Database Engine Tuning Advisor suggestion to replace syntax.
- Previous by thread: Re: intellisense not updating
- Next by thread: Re: Database Engine Tuning Advisor suggestion to replace syntax.
- Index(es):
Relevant Pages
|
Loading