1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| USE [RESOCRM]
GO
/****** Object: Trigger [dbo].[Typecontrat] Script Date: 03/29/2016 11:35:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER TRIGGER [dbo].[Typecontrat]
ON [dbo].[XCONTRAT]
AFTER update
AS
BEGIN
SET NOCOUNT ON;
declare @typecontrat nvarchar(100)
declare @societe int
select @societe = xcon_companyid from inserted
select @company = comp_companyid from company where comp_companyid = @societe
select @typecontrat = (select xcon_typecontrat from inserted where xcon_companyid = @societe)
update company set comp_typecontrat = @typecontrat where comp_companyid = @societe
END |
Partager