I am using a Table Variable in My stored Procedure. The stored procedure is too long. I need this Table variable in early part of the stored procedure only. How can I clean up the Table variable after I finished using it? I dont want it to exist untill stored procedure finishes.
You can't. The table variable is there for the scope of entire stored procedure. You can however do a DELETE FROM @MyTableVariableNameHere if you want to empty the table.