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 |
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2013-07-12 : 05:32:48
|
Hello,in sp1, there is a query like:select * into ##tblTest from tblMainin sp2, I am trying to access ##tblTestas follows:exec sp1select * from ##tblTestThe error message I get in sp2 is :Invalid object name '##tblTest'Any thoughts please?Thanks |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-07-12 : 06:02:42
|
tryexec sp1goselect * from ##tblTest ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2013-07-12 : 06:03:03
|
quote: Originally posted by arkiboys Hello,in sp1, there is a query like:select * into ##tblTest from tblMainin sp2, I am trying to access ##tblTestas follows:exec sp1select * from ##tblTestThe error message I get in sp2 is :Invalid object name '##tblTest'Any thoughts please?Thanks
The reason was that there was no data for the global table to be populated in the first place.Tahnks anyway... |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-07-12 : 06:06:57
|
quote: Originally posted by arkiboys
quote: Originally posted by arkiboys Hello,in sp1, there is a query like:select * into ##tblTest from tblMainin sp2, I am trying to access ##tblTestas follows:exec sp1select * from ##tblTestThe error message I get in sp2 is :Invalid object name '##tblTest'Any thoughts please?Thanks
The reason was that there was no data for the global table to be populated in the first place.Tahnks anyway...
ok that makes sense------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|