Hello everyone, is there any how to, uppon an update, do and insert retrieving the value of it? I mean, by this query
insert myTable(date) OUTPUT inserted.id values (GETUTCDATE())
it insert the value and return ID that I want, but when I try to pass it as a value on update, it doesn't work
update myOtherTable set indicator = ( insert myTable(date) OUTPUT inserted.id values (GETUTCDATE()) ) where status = 3
it keeps saying that there is a syntax error near insert