如何在数据库中检索截断表数据 [英] How Can I Retrive Truncate Table Data In Database

查看:84
本文介绍了如何在数据库中检索截断表数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要检索截断表的数据,所以我可以这样做吗? plz建议我一个想法.. !!

I want to retrive data of truncated table so can i do it...? plz suggest me an idea..!!

推荐答案

如果你有备份然后尝试从那里恢复,如果不是你需要第三方工具,请阅读: http://stackoverflow.com/questions/4193402/how-to-recover- data-from-truncated-table [ ^ ]
If you have a backup then try to restore from that, if not you need a third party tool, read this : http://stackoverflow.com/questions/4193402/how-to-recover-data-from-truncated-table[^]


您好,



查看此链接:

http://blog.sqlauthority.com/2010 / 03/04 / sql-server-rollback-truncate-command-in-transaction / [ ^ ]



http://blog.sqlauthority.com/2007/12/26/sql -server-truncate-cant-back-using-log-files-after-transaction-session-is-closed / [ ^ ]



如果在代码中使用TRANSACTIONS,则可以回滚TRUNCATE。如果没有使用事务并且提交了TRUNCATE操作,则无法从日志文件中检索它。 TRUNCATE是DDL操作,它没有记录在日志文件中。



DELETE和TRUNCATE都可以在使用TRANSACTION时回滚,如果当前会话没有关闭。如果在TRANSACTION包围的查询编辑器中写入TRUNCATE,并且会话已关闭,则无法回滚,但可以回滚DELETE。



检查此 http://raresql.wordpress.com/ 2012/04/04 / how-to-recover-truncated-data-from-sql-server-without-backup / [ ^ ]

< br $>


问候,

Praneet
Hi,

Check this link:
http://blog.sqlauthority.com/2010/03/04/sql-server-rollback-truncate-command-in-transaction/[^]
and
http://blog.sqlauthority.com/2007/12/26/sql-server-truncate-cant-be-rolled-back-using-log-files-after-transaction-session-is-closed/[^]

If you use TRANSACTIONS in your code, TRUNCATE can be rolled back. If there is no transaction used and TRUNCATE operation is committed, it can not be retrieved from log file. TRUNCATE is DDL operation and it is not logged in log file.

DELETE and TRUNCATE both can be rolled back when TRANSACTION is used and if the current session is not closed. If TRUNCATE is written in Query Editor surrounded by TRANSACTION and if session is closed, it can not be rolled back but DELETE can be rolled back.

Check thishttp://raresql.wordpress.com/2012/04/08/how-to-recover-truncated-data-from-sql-server-without-backup/[^]


Regards,
Praneet


这篇关于如何在数据库中检索截断表数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆