怎么在调试时清除临时表
如何在调试时清除临时表用临时表时碰到错误Msg 2714, Level 16, State 6, Line 3There is already an obje
如何在调试时清除临时表
用临时表时碰到错误
Msg 2714, Level 16, State 6, Line 3
There is already an object named '#TblProdOrders' in the database.
然后我在代码前加了一段。
if OBJECT_ID('#TblProdOrders') is not null
drop table #TblProdOrders
但明显这段不起作用,我想应该是因为临时表不是运行于当下的数据库,而是在tempdb里。请问如何在调试时清除临时表。谢谢。
[解决办法]抢分~~呵呵
if OBJECT_ID('tempdb..#TblProdOrders') is not null
drop table #TblProdOrders
[解决办法]
if OBJECT_ID('tempdb..#TblProdOrders') is not null drop table #TblProdOrders
[解决办法]if OBJECT_ID('#TblProdOrders') is not null
drop table #TblProdOrders
go
create table #TblProdOrders
.......
没必要加那么多东西,不过加上还是比较保险一点。