Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews New MS SQL Server Interviews:MS SQL Data MiningMS SQL Reporting ServicesMS SQL Server 2008MS SQL Server IndexesMS SQL Server JoinsMS SQL Server OptimizationMS SQL Server ReplicationMS SQL Server ViewsMS SQL Server XML IntegrationSQL Database ConceptsSQL Server ArchitectureSQL Server ConstraintsSQL Server CursorsSQL Server Database AdministratorSQL Server FunctionsSQL Server LocksSQL Server Service BrokerSQL Server TriggersSQL Stored ProceduresSSISTransaction Server
Copyright © 2018. All Rights Reserved
SQL Server Cursors Interview Question:
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
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.