all groups > sql server (alternate) > august 2003 >
You're in the

sql server (alternate)

group:

SP returning a table -- ?


SP returning a table -- ? jim_geissman NO[at]SPAM countrywide.com
8/29/2003 2:55:50 PM
sql server (alternate):
There's an SP that in effect returns a table -- it loops and executes
statements like SELECT @field1, @Field2, @Field2

Can I capture its results in a table? I know that if it were a FUNCTION
that returned a table, that would be simple:

INSERT ResultsTable SELECT * FROM dbo.Function (@Param1, @Param2)

Re: SP returning a table -- ? John Bell
8/30/2003 12:54:57 AM
Hi

Check out the form of insert statement that calls exec

INSERT INTO <TABLE> execute_statement

i.e INSERT INTO <TABLE> EXEC stored_procedure

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ia-iz_5cl0.asp?frame=true

John


[quoted text, click to view]

AddThis Social Bookmark Button