CREATE TRIGGER [update_ryda_log] ON [dbo].[d_c_ryda]
FOR UPDATE
AS
IF UPDATE (ry_name)
begin
insert into d_c_ryda_log (pk,cloumn_name,bgnr,edit_date,edit_user)
select inserted.ry_code,'人员姓名',deleted.ry_name+'->'+inserted.ry_name,getdate(),inserted.edit_user from inserted,deleted where inserted.ry_code=deleted.ry_code and inserted.ry_name<>deleted.ry_name
end