SQL- @@ROWCOUNT -返回上一行执行影响的行行数

DECLARE @AFFECT INT
declare @t table(name nvarchar(20),qy nvarchar(20),je int)
insert into @t
select N'产品一',N'北京',500
union all select N'产品一',N'上海',300
union all select N'产品二',N'北京',600
union all select N'产品三',N'上海',1000
union all select N'产品三',N'北京',8008
union all select N'产品四',N'上海',400
print @@ROWCOUNT

update @t set je = 200 where name =N'产品一'
SET @AFFECT=@@ROWCOUNT
print @AFFECT

posted @ 2019-04-17 10:00  轻烟随风  阅读(423)  评论(0编辑  收藏  举报