CREATE TRIGGER [updatedate] ON [dbo].[ic_card_info] FOR UPDATE AS if update(开票截止日期) update [dbo].[ic_card_info] set 开票日期是否更新=1可是这样一改的话所有的记录就都更新了 怎么能只更新一条当前记录呢?
create procedure update_table @a [nvarchar](10) as update table set 字段a=@a where 字段b=xxx if @@Rowcount=1 begin update table2 set 字段c=xxxx end
如果有id字段CREATE TRIGGER [updatedate] ON [dbo].[ic_card_info] FOR UPDATE AS if update(开票截止日期) update [dbo].[ic_card_info] set 开票日期是否更新=1 from inserted i where [dbo].[ic_card_info].id = i.id
FOR UPDATE
AS
if update(开票截止日期)
update [dbo].[ic_card_info] set 开票日期是否更新=1可是这样一改的话所有的记录就都更新了
怎么能只更新一条当前记录呢?
@a [nvarchar](10)
as
update table set 字段a=@a where 字段b=xxx
if @@Rowcount=1
begin
update table2 set 字段c=xxxx
end
FOR UPDATE
AS
if update(开票截止日期)
update [dbo].[ic_card_info] set 开票日期是否更新=1 from inserted i where [dbo].[ic_card_info].id = i.id