In SQL Server 2008 and higher what is the best/safest/most correct way
And if you mean select the ID of the last record inserted, its
SELECT @@IDENTITY FROM table