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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 PreparedStatement vs. SQL-Statement-execution plan

Author  Topic 

luggi
Starting Member

4 Posts

Posted - 2007-12-07 : 08:27:05
Hello,

I have a problem with an execution plan within a PreparedStatement. It's been executed with clusterd index scan. The same statement executed in Management Studio runs in clustered index seek, which is much faster.

Any ideas?

Many Thanks!

Luggi

nr
SQLTeam MVY

12543 Posts

Posted - 2007-12-07 : 10:57:28
Does the prepared statemennt have parameters?
It will create the plan on first run so if the parameters or statistics change it might end up with a bad plan.
Try clearing the cache and see if the plan changes.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -