SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Time Out Problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sanjnep
Posting Yak Master

USA
190 Posts

Posted - 01/14/2009 :  17:47:29  Show Profile  Visit sanjnep's Homepage  Reply with Quote
I have a store procedure and contains 2 update statements like

create procedure sp_update
as
begin tran
update table A
update table B
commit tran

When 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?
Thanks
ss

tkizer
Almighty SQL Goddess

USA
35007 Posts

Posted - 01/14/2009 :  17:52:51  Show Profile  Visit tkizer's Homepage  Reply with Quote
Could you post the actual stored procedure as it is hard for us to help with what you have posted?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sanjnep
Posting Yak Master

USA
190 Posts

Posted - 01/14/2009 :  18:05:04  Show Profile  Visit sanjnep's Homepage  Reply with Quote
create procedure sp_fromsisyio
@id int,@nsnumber int
as

declare @ErrCode int

begin tran

update tbl_logsis set date = getdate() where id = @id

select @ErrCode = @@Error

If @ErrCode <> 0
Begin
Rollback Transaction
End

update tbl_errorcode set date = getdate() where nsmumber = @nsnumber

If @ErrCode <> 0
Begin
Rollback Transaction
End

commit Tran
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
35007 Posts

Posted - 01/14/2009 :  18:07:20  Show Profile  Visit tkizer's Homepage  Reply with Quote
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 Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

Edited by - tkizer on 01/14/2009 18:07:50
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000