sql server 更新/新增一条语句,返回其中某一列的值 inserted,@@IDENTITY()

一:更新/新增一条语句,返回其中某一列的值

update product set state=1 

output inserted.state

where id=@id

二:新增一条语句,返回自增列Id

insert into Product values();select @@IDENTITY() as new_id

猜你喜欢

转载自blog.csdn.net/liuchang19950703/article/details/80887657
今日推荐