Table Variables : Declare Variables « Transact SQL « SQL Server / T-SQL






Table Variables

 

4>
5>
6> DECLARE @T1 TABLE(col1 INT);
7> INSERT @T1 VALUES(1);
8> SELECT * FROM @T1;
9> GO
col1
-----------
          1
1>
2>

 








Related examples in the same category

1.Declare a varchar variable
2.Declare a variable
3.Use declared variable in SQL statement
4.Declares a local variable (@intvar) and then assigns a value to the variable