As a TSQL Developer or DBA, while writing TSQL code for the business login or DBA maintenance tasks, we come across the situation to work on temporary data. To accomplish this, we generally use temporary table or table variable. The most confusing problem is “which one is the best for my algorithm?” This is a question which creates lots of confusion between TSQL professionals. The reason for this confusion is the lack of knowledge about the differences between temporary table and table variable. This lab is divided into nine exercise. In the first exercise, we will learn scope of temporal objects. In the second exercise, we will learn Schema modifications of temporal objects. In the third exercise, we learn the behavior of temporal objects with SELECT INTO statement. In the fourth exercise, we will learn usage of IDENTITY INSERT with temporal objects. In the fifth exercise, we will learn about cardinality estimation on temporal objects. In the sixth exercise, we will learn about temporary tables within explicit transactions. In the seventh exercise, we will learn about temporal objects within user-defined functions and with user-defined types. In the eighth exercise, we will learn, indexing and collation in temporal objects. In ninth exercise, we will learn the behavior of temporal objects with in dynamic SQL and with TRUNCATE command. After completion of this lab, we will be able to choose the best one to use in our TSQL code.
Exercise 1: Scope of Temporary Table and Table Variable
Exercise 2: Schema Modification for Temporary Tables and Table Variables
Exercise 3: Use of Temporary Objects with SELECT INTO Statement
Exercise 4: Use of IDENTITY INSERT with Temporary Objects
Exercise 5: Cardinality Estimation on Temporary Objects
Exercise 6: Temporary Objects within Explicit Transaction
Exercise 7: Temporal Objects in user-defined functions and user-defined types
Exercise 8: Indexing and Collation in Temporal objects
Exercise 9: Dynamic SQL and TRUNCATE with temporal objects
There are no reviews yet.