Create Trigger while update any column of table



CREATE TRIGGER trgAfterContractDeedFileURLUpdate ON  [Contract]
FOR UPDATE
AS
begin
    declare @BusinessUnit nvarchar(50)
    set @BusinessUnit = 'Insert To ContractDeedUrlHistory if Contract Deed URL is updated.'

    insert into
        ContractDeedUrlHistory(ContractNo,ContractDate, OwnerID,ContractDeedUrl,Entry_By,Entry_Date)
    SELECT
        ContractNo,ContractDate, OwnerID,ContractDeedUrl,Entry_By,Entry_Date
    FROM
        deleted
     
end

Comments

Popular posts from this blog

How to use DbFunctions.TruncateTime

Microsoft Access Connectivity from C#

Tool 'dotnet-ef' failed to install. dotnet core