create table z(id int, name varchar(200))
insert into z values(1,'First')
insert into z values(2,'Second')
insert into z values(3,'Third')
select * from z
GO
DELETE FROM z
OUTPUT deleted.ID, deleted.name
WHERE (z.id=1)
GO
update z set id=10 output inserted.id,inserted.name
where id=1
GO
insert into z
output inserted.id
values (5,'five')
http://stackoverflow.com/questions/121243/hidden-features-of-sql-server
insert into z values(1,'First')
insert into z values(2,'Second')
insert into z values(3,'Third')
select * from z
GO
DELETE FROM z
OUTPUT deleted.ID, deleted.name
WHERE (z.id=1)
GO
update z set id=10 output inserted.id,inserted.name
where id=1
GO
insert into z
output inserted.id
values (5,'five')
http://stackoverflow.com/questions/121243/hidden-features-of-sql-server
No comments:
Post a Comment