创建触发器

USE [DataServiceCenterDBNH]
GO

/****** Object: Trigger [dbo].[insertAir2019] Script Date: 01/07/2019 17:34:58 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


-- ================================================
-- Template generated from Template Explorer using:
-- Create Trigger (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- See additional Create Trigger templates for more
-- examples of different Trigger statements.
--
-- This block of comments will not be included in
-- the definition of the function.
-- ================================================
-- =============================================
-- Author: <Author,符攸庆>
-- Create date: <Create Date,2018-12-12 20:30:50>
-- Description: <Description,空气质量数据同步南海库>
-- =============================================
CREATE TRIGGER [dbo].[insertAir2019]
ON [dbo].[Air_h_2019_M14999_Src]
AFTER insert
AS
BEGIN
declare @StationCode varchar(10), @TimePoint datetime, @PollutantCode varchar(5),@MonValue decimal(10, 3);
set @StationCode='A440605001';
select @TimePoint=TimePoint,@PollutantCode=PollutantCode,@MonValue=MonValue from inserted

insert into [Skyland.MSC.NH].[dbo].[Air_h_2019_A440605001_Src]([StationCode]
,[TimePoint]
,[PollutantCode]
,[MonValue])
values(@StationCode,@TimePoint,@PollutantCode,@MonValue);
END


GO

 

转载于:https://www.cnblogs.com/luoguixin/p/10234561.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值