var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: 'Instead Of' Triggers particularly Update
I am trying to understand how to use instead of trigger using an update.
Here are a few things that I need clarified.
- When using an 'instead of Update' trigger is this replacing any other Update that is happening to the Table.
- Or, is the occurence of the trigger happening after the update?
- Also, I have seen some syntax where people use:
set field1 = inserted.field1
from deleted, inserted, table
where deleted.field1 = ....
Does this mean that when using the 'instead of' option it keeps track of
what is being deleted and what is being inserted by using such things as deleted.field1 or inserted.field1?
What I need to do is check that the previous value in a particular field is null before updating it. I don't want to update a particular field that already contains a value in it.
You sure you want this on a trigger? It will make it impossible to update any information in your table, even manually.
Have you considered using this syntax in your stored procedure:
Set Column1 = Coalesce(Column1, NewValue1),
Column2 = Coalesce(Column2, NewValue2),