create table t3
(
sid int not null primary key,
sname varchar(10)
)
insert into t3 values(101,'wind')
insert into t3 values (102,'snow')
insert into t3 values(103,'kiki')
select * from t3
select * into t4 from t3 where 1=0
select * from t4
---- insert
insert into t4
output inserted.sid,inserted.sname
select sid,sname from t3
---update
--返回update字段前後的值
update t4 set sname='snow'
output deleted.sname,inserted.sname
where sid=101
---- delete
--返回刪除的值
delete t4
output deleted.sid,deleted.sname
where sid=103
查看本欄目