>>I'm not able to found a command for release a Declared Table variable.
>>
>>I cannot think that a way does not exist.
>>If I write a sp very complex one,
>>where i declare 300 table variables !!!
>>
>>Thanks
>>Fabio
>
>This is an old thread, but I just came across it and I would recommend to use temp tables for such scenario (so you can drop them). Table variables can not use parallelism, so using temp tables can yield better performance.
>
>See this very interesting article
http://sqlblog.com/blogs/peter_larsson/archive/2009/10/15/performance-consideration-when-using-a-table-variable.aspx by Peter Larsson.
Performance is not the first rule on programming.
The first is: minimize design errors, programming errors and bugs
I use @table variables rarely.
But it can to be usefull to implement a good programming model.
If you call a black box sp out of your control and you wish a local stack table,
a @table variable it is the only choice.
For the MSSQL's parallelism, to be honest until now I have seen more problems than benefits