Explain Temporary table VS Table variable by using Cursor alternative?
Submitted by: AdministratorTemporary table
This can improve processing speed but consume disk space.
Table variable
Table variable that can be used in stored procedures, functions and batches.
Table variable get destroyed at the end of the stored procedure, function or batch in which it is defined.
Since it can be used in stored procedure, it is compiled once and can be used many times.
You can't create index on the Table variable.
Since you can create index on the temporary table, it is good where data is huge.
Submitted by: Administrator
This can improve processing speed but consume disk space.
Table variable
Table variable that can be used in stored procedures, functions and batches.
Table variable get destroyed at the end of the stored procedure, function or batch in which it is defined.
Since it can be used in stored procedure, it is compiled once and can be used many times.
You can't create index on the Table variable.
Since you can create index on the temporary table, it is good where data is huge.
Submitted by: Administrator
Read Online SQL Server Cursors Job Interview Questions And Answers
Top SQL Server Cursors Questions
☺ | What is cursor in MS SQL Server? |
☺ | Explain the cursor lock types? |
☺ | What is scrollable cursor? |
☺ | Do you know the capabilities of Cursors? |
☺ | Explain Temporary table VS Table variable by using Cursor alternative? |
Top New MS SQL Server Categories
☺ | SQL Server Database Administrator Interview Questions. |
☺ | SQL Server Service Broker Interview Questions. |
☺ | SQL Server Locks Interview Questions. |
☺ | SQL Server Constraints Interview Questions. |
☺ | MS SQL Data Mining Interview Questions. |