Table Variable is used to store set of rows temporarily.
Table variables memory allocated in the ram.
Table variable cannot maintained relationship with other table variable.
You create a table variable the same way you create any other variable: using the declare statement:
declare @TableVar table (CustomerID nchar(5) NOT NULL)
This declares a table variable named @TableVar that we can use in place of a temporary table. You can use a table variable for just about anything you'd use a regular table.