Greg Low shares some queries and some history:
Sequences allow us to create a schema-bound object that is not associated with any specific table.
For example, if I have a Sales.HotelBookings table, a Sales.FlightBookings table, and a Sales.VehicleBookings table, I might want to have a common BookingID used as the key for each table. If more than the BookingID was involved, you could argue that there is a normalization problem with the tables, but we’ll leave that discussion for another day.
Another reason I like sequences is that they make it much easier to override the auto-generated value, without the need for code like
SET IDENTITY_INSERTthat we need withIDENTITYcolumns. This is particularly powerful if you ever need to do this across linked servers, as you’ll quickly find out that it doesn’t work.Sequences let me avoid these types of issues: they perform identically to
IDENTITYcolumns, and they also give me more control over the cache for available values.
Click through for some queries to find the latest value of a sequence, as well as how this functionality has changed over the years. One thing that I would point out is that, on busy systems, you might find that the value has changed between the time you run this query and the time you use the results.