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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Stored Procedures

Author  Topic 

tunny2011
Starting Member

1 Post

Posted - 2011-11-21 : 11:04:59
Hello,

I'm confused!!

I have wrote a sql statment that has a variable declared (week) at the top of it and when run it only takes 2/3 seconds to run, I have now turned the same sql statment into a store procedure and pass in the same value as a variable and the stored procedure and it just sits and runs.

Any idea why there is such a difference?

Thank you

Andy

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-11-21 : 11:14:15
sounds like

http://www.simple-talk.com/sql/t-sql-programming/parameter-sniffing/

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -