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 2000 Forums
 Transact-SQL (2000)
 Problem with sp_execute_sql

Author  Topic 

vipinspg
Starting Member

12 Posts

Posted - 2005-05-17 : 05:46:21
Hi All

I'm having an SP where I execute dynamic sql statements. Earlier I was using "execute" to execute the dynamic sql statements and recently changed to sp_execute_sql for executing the dynamic sql statements (only for fetching data). But its a very long SP and after replacing execute with sp_execute_sql, I have experienced one peculiar issue,ie, some other SPs(not related to this sp, but using similar tables) taking too much time to execute. Later I removed sp_execute_sql and again started using execute, and now all the issues resolved.

Could you please tell me how this happens ?

Thank you very much for your time.

Thanks
Vipins

.

brendalisalowe
Constraint Violating Yak Guru

269 Posts

Posted - 2005-05-17 : 15:59:52
I read somewhere that it is better not to put "sp" in front of the name because when you do it uses the master database. If there is not "sp" then it goes to exactly where it is supposed to. Make sense?

Brenda

If it weren't for you guys, where would I be?
Go to Top of Page
   

- Advertisement -