SQL Server 上的表中的数据丢失
我在 SQL Server 2005 上的一个数据库上遇到了一些奇怪的行为,我制作了一个应用程序来存储一些数据,我只有 1 个用于客户查询的存储过程,其中我只有一些选择(没有删除或更新操作),但是由于某种原因,在一个随机时刻(我还没有找到发生这种情况的确切时刻),我的两个重要表中的数据以某种方式被删除,并且表只保留几行。
我使用 My Generation 将数据库映射到 .NET 上的对象上,并且我的方法仅在必要时删除一行,有时当我在 SQL Server 2005 Managment studio 上进行一些查询时,数据库没有完成查询,而且它没有完成不回应。
我不知道为什么会发生这种情况,这让我在工作中感到头疼。我将不胜感激对此的一些帮助。谢谢。
I'm having some strange behavior with one data base on SQL Server 2005, i made an application to store some data, i have only 1 store procedure for custome querys in wich i only have some selects (no delete, or update operations) but for some reason, at a random moment (i havent found the exact moment when this happens) the data from my 2 important tables is someway deleted an the tables only keeps a couple of rows.
I use Mygeneration to map tha database on objects on .NET, and my methods only delete one row at time when is necesary,some times when i make some querys on SQL Server 2005 Managment studio the database don't finish the querys and it doesn't response.
I don't have any clue why this is happening and its giving me some headache at work. I'll apreciate some help with This. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要找出谁在执行删除操作。创建一个
FOR DELETE
触发器,将每次删除的 getutcdate()、SUSER_SNAME()、@@SPID 和其他有趣的信息记录到另一个表中。但是我怀疑您的数据库正在被 MyGeneration 完全删除并重新创建,也许每次您重建所有数据库时?
You need to find out who is doing the deletes. Create a
FOR DELETE
trigger which logs getutcdate(), SUSER_SNAME(), @@SPID and other interesting information to another table for each deletion.However I suspect that your database is being completely deleted and recreated by MyGeneration, perhaps every time you rebuild all?