Hi, We have runned into a problem with an sp.
We have a pretty simple sp containing a declared table and a couple of outer joins that in the end returns between 20 and 100 rows.
Since querying this sp has been giving us poor performance both in production and in testenvironment we recently rewrote it to be more efficient and has tested thouroughly with great performance in our testenvironment.
We released it to production just to find out that it is still very slow and are causing our .NET 2.0 application to timeout when it is called.
We understood nothing and went into Management Studio on the production database and ran the sp there, it executes under 1 sec.
That is, when ran from our application it is extremly slow and causes timeouts, when ran from Management Studio it is very quick and never takes more then a second.
Anyone with good knowledge of SQL Server 2005 that can give us a hint regarding this?