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
查看本栏目更多精彩内容:http://www.bianceng.cnhttp://www.bianceng.cn/database/SQLServer/
时间: 2024-11-05 18:48:26