i have a table known as Persons which is (IdCode :pk, not null ,Identity). now i want to have(select) the last inserted IdCode in the table, how can i do that? ofcourse i have to join one another table to this table and then extract IdCode from both of them
at the end i want to show results in Asp.net GridView , so can i apply this query in Function and then call this function by sroted procedure and then use it in Asp.net connection?
i am also using SqlServer2008r2,
thank's in your advise