If I'm interpreting your logic correctly you should just get rid of the ELSE and you'll be fine. Actually, try this
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER TRIGGER [trig_updateOrganization]
ON [dbo].[OrganizationDetail]
FOR UPDATE
AS
DECLARE @oldName VARCHAR(100)
DECLARE @newName VARCHAR(100)
DECLARE @oldAddress VARCHAR(100)
DECLARE @newAddress VARCHAR(100)
declare @Changed bit
set @Changed = 0
IF UPDATE(Org_name)
BEGIN
SELECT @oldName = (SELECT Org_name + ' ' FROM Deleted)
SELECT @newName = (SELECT Org_name + ' ' FROM Inserted)
PRINT 'Organization name changed from "' + @oldName +'" to "' + @newName + '"'
set @Changed = 1
END
IF UPDATE(Org_address)
BEGIN
SELECT @oldAddress = (SELECT Org_address + ' ' FROM Deleted)
SELECT @newAddress = (SELECT Org_address + ' ' FROM Inserted)
PRINT 'Organization address changed from "' + @oldAddress +'" to "' + @newAddress + '"'
END
if @Changed = 1
PRINT 'Have a nice day'
Thanks very much for using the code formatting block too - it makes it easier to read! 🙂 Finally, why the two spellings of address? There's no spelling of it without the double-d in any dictionary I've seen. I'm a bit of a pedant in that regard (saw a sign today at a clothes store saying "Priced too clear" - didn't buy a thing!) so I changed it :w00t: 😎 😀