heartstill

博客园 首页 新随笔 联系 订阅 管理
CREATE TRIGGER deletedBaseproperty ON LD_PE_BASEPROPERTY
INSTEAD OF DELETE
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
insert into LD_PE_BASEPROPERTY_DELETED(peCode,name,sex,photo,pID,married,nation,politic,born,origin,address,postCode,conTel,highEdu,graSchool,profession,perPost,stuExper)
SELECT * FROM DELETED --该句执行报错

--再删除一次
delete LD_PE_BASEPROPERTY where 表的主键 in (select 表的主键 from DELETED)

END
GO
posted on 2011-11-24 12:50  开始测试  阅读(1292)  评论(0编辑  收藏  举报