误删恢复某些数据库记录

use lgdb
go
if exists(select name from sysobjects where xtype='u' and name ='TEMPlgzx_tzlgl')
drop table TEMPlgzx_tzlgl
go
if exists(select name from sysobjects where xtype='u' and name ='TEMPlgzx_tdir')
drop table TEMPlgzx_tdir
 
 
go
--复制误删除的数据到临时表(目录表)
select * into TEMPlgzx_tdir  from lgzx_tdir where id in
(    
     select id from lgzx_tdir where name ='记者招待会'      
)

GO

posted @ 2010-06-04 21:52  邓维  阅读(662)  评论(0编辑  收藏  举报