rmatthew Posted February 19, 2006 Posted February 19, 2006 Is it possible to change the value of an inserted item from within an insert trigger? Such as inserted.[field] = 1 There are several reasons, but one of them is to replace a value with a default if the value doesn't meet a FK Constraint so as to allow the insert to happen. Quote
Mister E Posted February 19, 2006 Posted February 19, 2006 You can't update the "inserted" table and since the incoming row is violating the FK constraint it is not going to be allowed to be inserted. Your best bet is to adjust the FK value at the application or stored procedure level. There might be a gruesome hack out there somewhere though. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.