Temp variable can be created like this:
DECLARE e TABLE ( [Emp_ID] [int] NOT NULL, [Emp_Name] [varchar](max) NOT NULL ) INSERT INTO e SELECT 1,'Shashangka Shekhar' SELECT * FROM e GO
Table variable is always useful for less data. If the result set returns a large number of records, we need to go for temp table.