I have a table variable in a script (and not a stored procedure). Two questions:
- How to delete a table variable? Drop Table @varName gives the "Invalid snytax" error.
- Should I always do this? I heard that this is a good practice. Is it really necessary for small scripts like this?
Here is my code:
Declare @projectList table( name varchar(40) NOT NULL); Insert Into @projectList Values ('BCR-00021') Select * From @projectList Drop Table @projectList
sql sql-server table-variable
jtpereyda Apr 13 '11 at 18:00 2011-04-13 18:00
source share