数据库表不会删除(或显示其输入的数据)
如果我将 sql 查询语句应用于此表“select * from context.tablename”,我所看到的只是“正在执行查询..”消息,没有其他情况发生。 我也无法截断或删除该表。它甚至阻止我删除 vhole 数据库。
这个问题有可能是由向该表插入数据引起的吗???
我正在使用 MS Sql 服务器 2005
if i apply a sql query statement to this table "select * from context.tablename", all i see is the "Executing query.." message and nothing else hapens.
I also can not truncate or drop this table. It prevents me from even dropping vhole database.
Is it possible, that this problem is caused by inserted data into this table???
I'm using MS Sql server 2005
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您是否尝试过重新启动 SQL Server 服务?
Have you tried restarting the SQL Server service?
尝试删除表时是否有任何打开的数据库连接?您是否尝试过在删除之前关闭所有连接?
Are there any open connections to the database while trying to drop the table? Have you tried closing all connections before dropping it?
使用 SSMS 分离数据库。手动删除 MDF 文件。
Use SSMS to detach the database. Delete the MDF files manually.
对于只包含 3 条记录的表,我也遇到了同样的问题。我在 MS SQL Server Mgmt Studio 中打开了几个查询选项卡,每个选项卡都以某种方式引用了目标表,但没有一个选项卡执行任何查询。
从此表中进行选择只会无限执行,就像删除表一样。我可以运行 sp_spaceused 并看到它只使用了 86k 的空间,所以它并不大。
我断开了所有选项卡的连接,包括用于从表中选择和删除表的选项卡。然后我重新连接该窗口并运行“从我的表中选择*”,它起作用了。然后我也能够成功删除该表。
似乎有一个开放的连接以某种方式将表劫持并阻止我的“选择”和“删除”工作。
I had this same exact problem with a table that only contained 3 records. I had several query tabs open in MS SQL Server Mgmt Studio that each referenced the target table in some way, but none of which had any queries executing.
Selecting from this table would just execute endlessly as would Dropping the table. I could run sp_spaceused and see it was only using 86k of space so it wasn't huge.
I disconnected all of the tabs including the one I was using to Select from and to Drop the table. I then reconnected just that window and ran 'Select * from' my table and it worked. I was also able to then Drop the table successfully.
It seems there was an open connection holding the table hostage somehow and preventing my Select and Drop from working.