March 24, 2005 at 2:49 am
hi,
how to i pass a temporary table as a parameter to a stored procedure? I know you cant use a table variable to do that.
Regds
March 24, 2005 at 5:20 am
Wouldn't it be better to generate the temporary table inside the stored procedure? That way you just pass the parameters needed to generate it along with any other parameters you need.
March 24, 2005 at 5:34 am
http://www.sommarskog.se/share_data.html
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
March 24, 2005 at 6:10 am
hi,
all i'd like to know is whether it is possible to pass a temporary table as a parameter in a stored procedure???????????????????????????????????
If so, how.
Regds
March 24, 2005 at 6:15 am
TANSTAAFL.
Short answer, no. But please read the article I referenced
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
March 25, 2005 at 1:38 am
As Frank told you, it is impossible to pass a table as a parameter to a stored proc.
I personnally would use in your place a global temporary table (##Temp) which is available to all procs. The problem with the global temp table is that you have to manage it's lifecycle (from creation until destruction)
Bye
Gabor
March 25, 2005 at 12:56 pm
I personnally would use in your place a global temporary table (##Temp) which is available to all procs. The problem with the global temp table is that you have to manage it's lifecycle (from creation until destruction)
The other problem with global temp tables is that you can only have one instance of the named table at a time, so they don't work really well in multi-user applications.
Mattie
March 25, 2005 at 9:32 pm
You can use the table variable as a return from a UDF. I have used this successfully in the past.
Hope this helps!
Don
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply