创建触发器

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

 

posted @   不再犯错  阅读(262)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
历史上的今天:
2017-01-07 网上找到的一个jquery版网页换肤特效
点击右上角即可分享
微信分享提示