Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ================================================
- -- 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.
- -- ================================================
- SET ANSI_NULLS ON
- GO
- SET QUOTED_IDENTIFIER ON
- GO
- -- =============================================
- -- Author: Piotr Oslowski
- -- Create date: 2012-10-30
- -- Description: <Description,,>
- -- =============================================
- CREATE TRIGGER CDN.TwrKarty_SED_KategoriaABC
- ON CDN.TwrKarty
- AFTER UPDATE
- AS
- BEGIN
- -- SET NOCOUNT ON added to prevent extra result sets from
- -- interfering with SELECT statements.
- SET NOCOUNT ON;
- if Update(twr_wartosc2)
- Begin
- update cdn.twrkarty
- set twr_kategoriaabcxyz=left(twr_wartosc2,1) from cdn.twrkarty
- where twr_wartosc2 in ('a','b','c','d')
- AND twr_GIDNumer in (SELECT Twr_GIDNUmer from inserted)
- update cdn.twrparmag
- set tpm_kategoriaabcxyz=left(twr_wartosc2,1), TpM_TStampM = dateDiff(SECOND, '19900101', getdate()) from cdn.twrparmag
- join cdn.twrkarty on twr_gidnumer=tpm_twrnumer
- where twr_wartosc2 in ('a','b','c','d')
- AND Twr_GIDNumer in (SELECT Twr_GIDNumer from inserted)
- End
- -- Insert statements for trigger here
- END
- GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement