Disadvantages of table variable over temporary table:
• Since it cannot be passed as parameter from one stored procedure to another, there temporary tables are used.
• We cannot create non- clustered index.
• SQL Server does not maintain statistics on table variable.
• Table variable cannot be altered.
• It won’t participate in transaction rollbacks.
• It can’t use dynamic SQL, unless it is declared dynamically.
• While table sharing, nested stored procedures table variables cannot be used.
• It cannot be used for large resultsets, while needs indexes for query optimization.
• Since it cannot be passed as parameter from one stored procedure to another, there temporary tables are used.
• We cannot create non- clustered index.
• SQL Server does not maintain statistics on table variable.
• Table variable cannot be altered.
• It won’t participate in transaction rollbacks.
• It can’t use dynamic SQL, unless it is declared dynamically.
• While table sharing, nested stored procedures table variables cannot be used.
• It cannot be used for large resultsets, while needs indexes for query optimization.
0 comments:
Post a Comment