Let's say I have a table like this:
CREATE TABLE [A]
(
[X] INT,
[Y] INT,
[Z] INT
)
..that has an instead of update trigger. If I insert a row into this table:
INSERT INTO [A]
SELECT 1, 1, 1
Then I hit the update trigger with code like this:
UPDATE [A]
SET [X] = 2
WHERE [X] = 1
I'll end up with an [deleted] table like so:
X: 1, Y: 1, Z: 1
I'll end up with an [inserted] table like so:
X: 2, Y: 1, Z: 1
Is there any way to determine that only the X was actually set? In other words, how do I distinguish between:
UPDATE [A]
SET
[X] = 2,
[Y] = 1,
[Z] = 1
WHERE [X] = 1
...and the statement above?
Note: SQL Server 2008