I've looked at some other questions, they seem to be unrelated to SQL-Server.
Given the simple example query:
INSERT INTO tblComments (comment, user) VALUES ('lol', 'Guest')
Now suppose after the new user is created I need to insert some more data in other tables that require the last entered ID, I would do:
SELECT TOP 1 ID FROM tblComments ORDER BY ID DESC
To retreive the last entered ID, (hoping) that no queries have executed in the meantime, and that the returned ID is indeed for the value of the previous query.
I do keep my tables normalised, however I sometimes run into the situation where the inserted value may not necesserially be unique, so how can I guarantee the returned ID is the last one inserted?