I have declare a variable in SQL Server: Declare @variable
How can I drop or enable the variable when I don't need it?
|
I have declare a variable in SQL Server: How can I drop or enable the variable when I don't need it? |
|||||||||
|
Questions on Database Administrators Stack Exchange are expected to relate to database administration within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.
|
The scope of a variable lasts for the duration of when it is declared to the end of the batch or stored procedure. So in other words if you have something like this:
See the MSDN Reference on T-SQL Variables:
In other words, you don't explicitly drop variables like you do for other database objects. (the same goes for table variables as well) |
|||
|
|