If it is an Identity column, then you can query @@Identity to get the value of the most recent insert operation for the current connection. It does not work retroactively (you can't go back a day later and ask for the last Identity value for a give table).
Alternatively, you can use
SELECT MAX(MYCOLUMN) FROM MYTABLE
Technically, it won't give you the last entered value, only the highest. Robert Bradley
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.