Just for simplicity suppose I have two tables
user table (id, email)
user log table (id, date)
whatever id gets inserted in user table, same id should be inserted in user_log table also else transaction should fail.
How can I do this
BEGIN TRANSACTION
INSERT into user(id, email) OUTPUT Inserted.id (1, 'a@x.com', 'x'), (2, 'b@x.com', 'y')
// I also want to be able to do
INSERT into user_log(id, date) values(1, date), (2, date)
COMMIT TRANSACTION