Table variables are Transaction neutral. They are variables and thus aren't bound to a transaction.Temp tables behave same as normal tables and are bound by transactions.
The Next difference is that transaction logs are not recorded for the table variables. Hence, they are out of scope of the transaction mechanism.
The Third major difference is that any procedure with a temporary table cannot be pre-compiled, while an execution plan of procedures with table variables can be statically compiled in advance. Pre-compiling a script gives a major advantage to its speed of execution.
Finally, table variables exist only in the same scope as variables. Contrary to the temporary tables, they are not visible in inner stored procedures and in exec(string) statements. Also, they cannot be used in an insert/exec statement.
Monday, May 12, 2008
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2008
(13)
-
▼
May
(7)
- Application
- differences between httphandlers and httpmodules?
- how can i get the parent window objects in the chi...
- diiference between Except and Intersect in sql ser...
- difference between @Table datatype and temporary a...
- how can i get rownumber in sql server 2005?
- can i overload or override properties?
-
▼
May
(7)
No comments:
Post a Comment