I know Guid are randomly generated, Is there any way I can find out which one is latest Guid? As I have to get the latest inserted record in my table as my table has no timeContext column.
Thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, you cannot get this information.
If you need information, such as when a row was inserted, then you need to add a column to your table to track that information.
If you’re trying to mimic the “chained insert” style of inserts, where a row is inserted into one table, the
IDENTITY()value is obtained, then used to insert into further tables, you can instead generate the Guid value before the first insert – indeed, it’s one of the advantages of GUID identifiers that a whole set of related table changes can be prepared in isolation, without accessing the database at all.