Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Going parameterized causes problem
Message
From
30/09/2008 15:34:37
 
 
To
30/09/2008 12:42:54
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01351844
Message ID:
01351894
Views:
32
Does this help?

http://blogs.msdn.com/ianjo/archive/2005/11/10/491547.aspx


>For specific queries, when going parameterized, I have some major lack of performance. So, the following could be really long sometimes:
>
>
>DECLARE @Name varchar(20)
>DECLARE @Name2 varchar(20)
>DECLARE @ID integer
>set @Name = 'A301041%'
>set @Name2 = 'A301041%'
>set @ID = 1
>
>SELECT Client.Numero FROM Client WHERE (Client.Name LIKE @Name OR Client.Name2 LIKE @Name2) AND Client.ID=@ID
>
>
>This depends on the value entered. However, if I am not going parameterized, no matter the value, I will always get an optimized search result. But, for certain values, when going parameterized, it can take up to 8 to 50 seconds to find the same query.
>
>This has been discussed before. But, I really need to find what we need to adjust to avoid that.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform