@@IDENTITY returns the most recently created identity for your current connection, not necessarily the identity for the recently added row in a table. Always use SCOPE_IDENTITY() to return the identity of the recently added row.
Yesterday when I have played around with SQL Server 2008 Management Studio(SSMS) RC0. I have spotted a bug and I have filed a bug report. The new SSMS has Intellisense but it isn’t invalidated when you rename a column. When we fire SSMS and write a simple query everything is correct.
When I rename the column from Name to RoomName the Intellisense isn’t updated.
As you can see the column name is RoomName but Intellisense still proposes Name.
The Query editor is also not refreshed as shown above.
It says “Invalid column name” when the it’s perfectly valid. Note that the parse command completed successfully (as expected). The query runs with no problems.
I hope it will be fixed in the final release.