Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Cowboy
Yak Posting Veteran
72 Posts |
Posted - 2009-12-02 : 06:01:57
|
I have the following stored procedure and I noticed performance issues over it compared to when I just had a select statement. I am using it with .NET and my connection and command timeouts are both set to 90 seconds, the execution times in management studio are always really fast but real life performance is not:SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO @page int = 0ASBEGIN SET NOCOUNT ON;if @page = '0' select top 15 * from articles order by article_date descelse select * from articles order by article_date descEND I want to build a spaceship with ligthspeed capabilities and I don't even know what a wrench is. |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-12-02 : 06:46:01
|
In your SP declare a variable.Move @page to that variable.Then use that variable in your statement instead of using your parameter.It is worth to try.For more info look for parameter sniffing. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
Cowboy
Yak Posting Veteran
72 Posts |
Posted - 2009-12-02 : 09:17:05
|
| Could you post an example, I have looked at some examples but I can get them to integrate with my queryI want to build a spaceship with ligthspeed capabilities and I don't even know what a wrench is. |
 |
|
|
|
|
|