I have a table with id set as primary_key/is_identity, so I was wondering if I can assume the correctness in finding the row just inserted using SELECT TOP 1 in the middle of BEGIN TRANSACTION and COMMIT TRANSACTION by using a reverse order:
BEGIN TRANSACTION
INSERT INTO [MyTable] ([description], [name])
VALUES ('animal', 'cat')
SELECT TOP (1) [id], [description], [name]
FROM [MyTable]
ORDER BY [id] DESC
COMMIT TRANSACTION
Is that always correct, considering the mentioned constraints and the transaction instructions?