Hello,
I am using a software which updates a datetime column periodically in a SQL Server 2019 Database.
This software sometimes updates with an incorrect datetime value (eg '3262196-08-27 00:00:00') and generates a conversion error.
I have created an "INSTEAD OF UPDATE" trigger in order to check of this value before update and change it if needed.
When I issue an update statement with a correct value, I can see that the trigger fires correctly because of a message being printed during execution.
However, when I issue the problematic update statement, I get the conversion error and the message doesn't print, which leads me to believe that the trigger is not fired.
Is the datatype conversion checked before the trigger is fired ?
(i.e. update table set <datetime_field> = '3262196-08-27 00:00:00' where key = key
already produces a conversion to datetime)
How could I get the desired result, for instance changing this value to '2022-02-07 00:00:00' ?
Thank you for your help !