I am still a beginner, but I am having trouble with a T-SQL scalar variable during a create table. Can anyone tell me what is wrong with this script?
-- T-SQL MSSQL
SET NOCOUNT ON
DECLARE @tt = 'TempNWA'
--Create Temporary Table
CREATE TABLE [@tt]
( [Table_Name] varchar(50),
Row_Count int,
Table_Size varchar(50),
Data_Space_Used varchar(50),
Index_Space_Used varchar(50),
Unused_Space varchar(50)
)
DROP TABLE [@tt]
The error I get, which I can't decipher is:
Incorrect syntax near '='