输入banner图图片脚本导航/分类

mssql 创建触发器

ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: <Author,,Name> -- Create date: <Create Date,,> -- Description: <Description,,> -- ============================================= CREATE TRIGGER [dbo].[trigger_gfsbj] ON [dbo].[product] FOR INSERT AS BEGIN update o_product set pro_itime = getdate() from o_product as d inner join inserted as i on d.id=i.id END GO

创建后:

USE [GFSBJ]
GO
/****** Object:  Trigger [dbo].[trigger_gfsbj]    Script Date: 05/08/2016 13:04:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:        <Author,,Name>
-- Create date: <Create Date,,>
-- Description:    <Description,,>
-- =============================================
ALTER TRIGGER [dbo].[trigger_gfsbj]
   ON  [dbo].[product] 
   FOR INSERT
AS 
BEGIN
    update o_product set pro_itime = getdate() from o_product as d inner join inserted as i on d.id=i.id
END

 

mssql 创建触发器

标签: