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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-06-10 : 08:32:39
|
| joseph writes "hello i have a problem with this procCREATE PROCEDURE dbo.tmpInsert ASset nocount oncreate table #tmp (a int)insert into #tmpexec('select cast(3 as int) aa')select a from #tmpset nocount offdrop table #tmpGOwhen i use this code via any procedurescreate table #tmp (a int)insert into #tmpexec [test].[dbo].[tmpInsert]drop table #tmp i got this error: Server: Msg 8164, Level 16, State 1, Procedure tmpInsert, Line 5 An INSERT EXEC statement cannot be nested.BUT i found that the following code works greatcreate table #tmp (a int)insert into #tmpSELECT a.*FROM OPENROWSET('MSDASQL', 'DRIVER={SQL Server};SERVER=.;UID=sa;PWD=admin818', ' set fmtonly off exec [test].[dbo].[tmpInsert] ') AS aselect a from #tmpdrop table #tmpI looked up "set fmtonly off" on BOL but i did not any entry .can you explain it?is it work in multi user invironment good?Thanks in advance-yousef" |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2003-06-10 : 08:51:14
|
| I think you need to review the concepts of temp table scope. Maybe you mean #tmp in the proc to be different to #tmp in the dml ...Jay White{0} |
 |
|
|
|
|
|