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)
 Stored Proc execution

Author  Topic 

steve_rony
Starting Member

7 Posts

Posted - 2008-09-17 : 22:25:59
Hi,

I have written a stored procedure which consists of series of insert statements(around 20 inserts). When I am executing the stored procedure thorugh Management Studio it was in hung state after first insert. But when I execute each individual inserts it executes fine, let me know if anything is missing in the stored procedure.

Thanks,
Steve

hey001us
Posting Yak Master

185 Posts

Posted - 2008-09-17 : 22:27:38
how you are looping?

hey
Go to Top of Page

dexter.knudson
Constraint Violating Yak Guru

260 Posts

Posted - 2008-09-17 : 22:44:27
When the proc is running, in Server Management Studio, try navigating to Management -> Activity Monitor. Scroll right to see blocking & blocked-by where this is not zero & you can see if any other process is blocking what you are doing.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-18 : 00:17:26
quote:
Originally posted by steve_rony

Hi,

I have written a stored procedure which consists of series of insert statements(around 20 inserts). When I am executing the stored procedure thorugh Management Studio it was in hung state after first insert. But when I execute each individual inserts it executes fine, let me know if anything is missing in the stored procedure.

Thanks,
Steve


does the table have any enabled insert triggers?
Go to Top of Page

steve_rony
Starting Member

7 Posts

Posted - 2008-09-18 : 02:05:46
I am not using any loop but written a insert statements by populating into a temp table
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-18 : 02:26:04
quote:
Originally posted by steve_rony

I am not using any loop but written a insert statements by populating into a temp table


you didnt answer my question
Go to Top of Page

steve_rony
Starting Member

7 Posts

Posted - 2008-09-18 : 19:02:11
No there are no insert triggers used only normal insert scripts
Go to Top of Page

steve_rony
Starting Member

7 Posts

Posted - 2008-09-18 : 19:03:36
Can you brief me on how exactly can I check the blocking issues. I am using SQL Management Studion 2005.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-19 : 00:20:35
quote:
Originally posted by steve_rony

Can you brief me on how exactly can I check the blocking issues. I am using SQL Management Studion 2005.


just run sp_who2 and find out process that corresponds to your stored procedure execution. then look into blocked by column to see if some other process is blocking it (if its empty that means your process is not in blocked state.
Go to Top of Page
   

- Advertisement -