How to Declare Table Variable in SQL Server
To declare a table variable in SQL Server, start the DECLARE statement.
The name of the table variable must start with at(@) sign. The TABLE keyword defines that the used variable is a table variable. After the TABLE keyword, define column names and datatypes of the table variable in SQL Server.
SQL Server Table Variable
SQL Server Table variable is a local variable that stores data temporarily, similar to the temporary table in SQL Server.
Tempdb database is used to store table variables.