CREATE TABLE @username (name nvarchar(50))
Please suggest any option.
It should be either
CREATE TABLE username (name nvarchar(50))
DECLARE @username TABLE (name nvarchar(50))
As it is not possible to modify a Table Variable once created, and it can only have one index - the Primary Key - we always [well, nearly always!] add a PK in the declaration:
DECLARE @username TABLE ( [name] nvarchar(50) NOT NULL, ... any other columns ... PRIMARY KEY ( [name] ) )
No one has followed this question yet.