How to fix “Must declare the scalar variable” error when referencing table variable?

久未见 提交于 2019-11-27 22:44:51

This is a long standing parser issue. You need to get rid of the table prefix or wrap it in square brackets.

i.e.

delete from @CompanyGroupSites_Master 
where CompanyGroupID = @CompanyGroupID

or

delete from @CompanyGroupSites_Master 
where [@CompanyGroupSites_Master].CompanyGroupID = @CompanyGroupID

Not

delete from @CompanyGroupSites_Master 
where @CompanyGroupSites_Master.CompanyGroupID = @CompanyGroupID
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!