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 |
sanjnep
Posting Yak Master
191 Posts |
Posted - 2009-01-14 : 17:47:29
|
I have a store procedure and contains 2 update statements likecreate procedure sp_updateasbegin tranupdate table Aupdate table Bcommit tranWhen I ran it from Query Analyzer it runs fine but when I ran it from .NET I am getting timeout expire but still all the SQL command inside store procedure ran successfully. Can you help me plz to find the solution?Thanksss |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
sanjnep
Posting Yak Master
191 Posts |
Posted - 2009-01-14 : 18:05:04
|
create procedure sp_fromsisyio@id int,@nsnumber intasdeclare @ErrCode intbegin tranupdate tbl_logsis set date = getdate() where id = @id select @ErrCode = @@ErrorIf @ErrCode <> 0 Begin Rollback Transaction Endupdate tbl_errorcode set date = getdate() where nsmumber = @nsnumberIf @ErrCode <> 0 Begin Rollback Transaction Endcommit Tran |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2009-01-14 : 18:07:20
|
How long does it take to run in Query Analyzer? How many rows does each update statement affect? What is the timeout setting in the application?To see if you are getting a different execution plan from Query Analyzer than what the application is getting, run SQL Profiler and compare the execution plans.If the execution plans are identical, which I suspect they aren't, then I don't see any reason why this would be happening.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
|
|
|