I am trying to execute a SQL command which should draw on the last row that entered the database.

Basically, when a user submits the last thread (like in this forum), it redirects the user to a page with his thread title, thread paragraph and data such as a user name and time the thread was submitted.

so top 1 would give me the last thread inserted..what if two users insert a thread near the same time... my field is datetime.. how accurate is it?
–
Matrix001Jun 12 '11 at 7:21

3

Matrix001 - ORDER BY will order so the column with the largest datetime will be first. TOP 1 will make sure that all other rows are ignored. Also, from my understanding it does not matter what other users do as you filter by concrete user @UserID=t.UserId, right?
–
Alex AzaJun 12 '11 at 7:32