This blog shows how to create a table variable in sql server
Syntax:
DECLARE @TableName TABLE
(columnname <data_type> [ NULL | NOT NULL ] [ ,...n ])
Example:
DECLARE @Empsal TABLE
( EmpID int NOT NULL PRIMARY KEY,
Empsal money NOT NULL,
EmpCount int NOT NULL)
SQL Server Transact Basic to Expert - Create a table variable
SQL Server Transact Basic to Expert - Create a table variable


Join the conversation! Your thoughts help the community grow.