I would like SQL 2005 to provide the capability to know which columns were listed in an Insert statement from within an (instead of) insert trigger.
In particular I require this information for an Instead of Insert Trigger created on a View.
Compare the two statements ;
insert into vw_example(col1, col2, col3)
values (1, null, null)
insert into vw_example (col1, col2)
values (1, null)
Both statements appear the same from within the instead-of insert trigger, however, the second statement requires different processing to the first - in that it requires a default to be assigned to col3.
From within the Trigger both sets of "inserted" data contain nulls for col3, and thus, in the second example, col3 (which physically allows nulls) cannot be distinguished and be defaulted to a value, as is the intention when it is omitted from the insert parameter list (in this case).