Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed accessing the results of a sub-sproc within the caller?

Status
Not open for further replies.

VBDotNetProgrammer

Programmer
Jul 9, 2003
50
GB
Hi,

Im trying to execute a sproc from within another sproc, that isnt the problem i know how to do that.

The problem is i cant create a temp table in the sub-sproc holding the results which the calling sproc can then access.

What i need is something similar to a prototype in C++ where you forward declare something just so the compiler knows it will be there in the future.

Does anyone know a way around this?

Thanks
 
Slightly confused by your question, but ...

If an sproc is using a table which doesn't presently exist, you must create the table on the fly before creating the sproc, e.g
Code:
create table #temp1(col char(10))

create procedure myproc as
select * from #temp1
make any sense?

Greg.
 
Yes thanks, thats exactly what i did after much head scratching.

It is effectively tricking the compiler which didnt seem like the correct way to do things, i thought there would be a supported way of doing this but i guess that would be too logical!

Thanks anyway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top