255.触发器中被更新了的列名

49 阅读1分钟
--显示触发器中被更新了的列名
create trigger tr_process on 表
after insert,update
as
select name
from syscolumns 
where id=object_id('表')
	and (substring(columns_updated(),(colid-1)/8+1,1)
		&power(2,(colid-1)%8))=power(2,(colid-1)%8)
order by colid
go