June 15, 2005 at 9:36 am
Hi,
I have to create a stored procedure which will insert results into the tables. For this, I am thinking of creating a table variable and pass that table variable to the stored procedure. Is it possible? Also which one would be better. To create a table variable or to create a temp table?
Thanks,
Sridhar!!
June 15, 2005 at 9:51 am
If you need to share data between procs, you'll have to use a temp table.
Otherwise test both versions (variable, perm) and see which is faster in that situation.
June 15, 2005 at 9:52 am
The answer is: It depends. Based on the # of records, what is to be done with them, etc.. will determine #table or @table.
Generally, @table is for SMALL amounts of data with minimal processing done to them (I use them for 100 records or less).
#Table are for large data, large amounts of work, etc..
Reasoning:
1. @Table will write to DISK once it reaches a certain size
2. @Table has index limitations that #Table does not have
Good Hunting!
AJ Ahrens
webmaster@kritter.net
June 15, 2005 at 9:55 am
Thank you.
June 15, 2005 at 10:17 am
AND table variable datatype is not permited as a procedure parameter!
* Noel
June 15, 2005 at 10:18 am
is the #temp table allowed as a parameter?
June 15, 2005 at 10:26 am
I didn't mean to imply that! ... just that the poster said:
I am thinking of creating a table variable and pass that table variable to the stored procedure
Because #temp is not a variable you may think that the other one (@Table) which it is, may be used that way
* Noel
June 15, 2005 at 11:30 am
That's why I was asking for clarifications .
Are you back from vacations? Looks like you've been away forever.
June 15, 2005 at 11:35 am
Yep! Was on vacation last week.
Lots of rain in FL but every minute of sun and beach that could be taken ... were taken
* Noel
June 15, 2005 at 11:44 am
Lucky b@$t@rd. My vacations are in one month.
June 15, 2005 at 5:25 pm
so YOU are the reason I was soggy last week. I was blaming my mom for flying in. I live in Tampa Hope you had a good vaca Noel
Good Hunting!
AJ Ahrens
webmaster@kritter.net
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply