Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

UPDATE() function with Insert Trigger

$
0
0

I created a table with an Insert Trigger and then tried using the UPDATE() function to determine if the column value was passed.  E.g.,

   INSERT INTO mytable (col1, col2) VALUES ('hello', world');

versus

   INSERT INTO mytable (col1) VALUES ('hello');

Inside the Trigger UPDATE(col2) is always true.  I tried alternately with INSTEAD and AFTER with the same results.

There is no default value on Col2 and it is Nullable.

According to the documentation UPDATE() should work in an Insert Trigger as well as an Update Trigger.  Am I missing something?

Thanks.



Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>