MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
USE [Database] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER TRIGGER [dbo].[Ascent_UpdateSupplierStatus] ON [dbo].[ApSupplier] AFTER INSERT,UPDATE AS INSERT INTO [TriggerTablesAscent].[dbo].[SupplierStatus](SupplierCode, ActiveStatus, DateUpdated, UpdatedBy) SELECT i.Supplier, CASE i.OnHold WHEN 'Y' THEN 1 ELSE 0 END, CURRENT_TIMESTAMP, SYSTEM_USER FROM inserted as i LEFT OUTER JOIN [TriggerTablesAscent].[dbo].[SupplierStatus] tta ON i.Supplier = tta.SupplierCode WHERE CASE i.OnHold WHEN 'Y' THEN 1 ELSE 0 END <> tta.ActiveStatus
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|SQL query to select one row with min and max date from multiple table rows||24||55|
|Sorting a SQL script||5||38|
|Datatable / Dates ?||4||29|
|Delete duplicates from SQL Server table||2||24|
Join the community of 500,000 technology professionals and ask your questions.