【发布时间】:2009-02-12 19:56:02
【问题描述】:
以下(经过清理的)代码有时会产生这些错误:
无法删除表“database.dbo.Table”,因为它不存在或您没有权限。
数据库中已经有一个名为“表”的对象。
begin transaction
if exists (select 1 from database.Sys.Tables where name ='Table')
begin drop table database.dbo.Table end
Select top 3000 *
into database.dbo.Table
from OtherTable
commit
select * from database.dbo.Table
代码可以同时运行多次。有人知道它为什么会坏吗?
【问题讨论】:
标签: sql-server multithreading tsql transactions transaction-isolation