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 2008 Forums
 Transact-SQL (2008)
 INSERT Exec cant be nested

Author  Topic 

Sql_forum
Yak Posting Veteran

50 Posts

Posted - 2012-06-20 : 05:58:43
Hi,
I have a proc

CREATE PROC A
AS
BEGIN
i have two temp tabels T1,T2
INSERT INTO T1 EXEC PROC1
INSERT INTO T2 EXC PROC2
END


When i execute the main proc... it is giving error "Insert execute cannot be nested...."


can anyone hlp me quickly??

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2012-06-20 : 06:30:00
Is this due to a transaction?

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

Sql_forum
Yak Posting Veteran

50 Posts

Posted - 2012-06-20 : 06:46:40
no.. i m not using any transaction queries
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2012-06-20 : 09:03:18
What is procedure doing? Is it inserting data to any of these tables?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2012-06-20 : 09:06:53
Is there an insert ... exec in PROC1 or PROC2 - or anything that might cause this?

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

- Advertisement -