How do I drop table variables in SQL-Server? Should I even do this?

前端 未结 7 1959
执笔经年
执笔经年 2020-12-12 18:58

I have a table variable in a script (not a stored procedure). Two questions:

  1. How do I drop the table variable? Drop Table @varName gives an \"Incorrect snyta
7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-12 19:07

    Table variables are automatically local and automatically dropped -- you don't have to worry about it.

提交回复
热议问题