完整的程序是这样的: use northwind if exists (select name from sysobjects where name = 'tr_product_update' and type ='tr') drop trigger tr_product_update gouse northwind gocreate trigger tr_product_update on products for update as declare @msg varchar(100) select @msg = str (@@rowcount)+'employees updated by this statement' print @msg return go 那,@@rowcount所表示的那最后执行的一条SQL语句是什么呢? 是declare 语句吗?
str (@@rowcount)+'employees updated by this statement' 这是在sql server中进行字符串运算。得到一个字符串结果赋值给@msg 然后,打印这个@msg 就是这样。
@@rowcount,表示最后执行的一条SQL语句所影响的行数!
use northwind
if exists (select name from sysobjects
where name = 'tr_product_update' and type ='tr')
drop trigger tr_product_update
gouse northwind
gocreate trigger tr_product_update on products
for update
as
declare @msg varchar(100)
select @msg = str (@@rowcount)+'employees updated by this statement'
print @msg
return
go
那,@@rowcount所表示的那最后执行的一条SQL语句是什么呢?
是declare 语句吗?
这是在sql server中进行字符串运算。得到一个字符串结果赋值给@msg
然后,打印这个@msg
就是这样。