I'm hoping someone can point me in the right direction on this one. Here's my workings out so far.
SELECT * FROM sys.identity_columns is a system view which gives "last_value" but the definition for that view uses an internal function
IdentityProperty(colName, 'LastValue') - so that's a dead end (not pulling it from a system table there).
Everywhere (I've looked) on the internet suggests using
DBCC IDENT_... commands to uncover the value but that still leaves me in the dark as to where it's actually stored.
So, I arrived at searching the individual pages with
DBCC PAGE(TestDB,1,1325,3) against my test harness db and using the
RESEED command to reseed between values 10 and 12.
In doing this, I noticed the hex values on the
IAM: Single Page Allocations and
IAM: Extent Alloc Status Slot 1 all changed. (And realised they change periodically anyway along with the bUse1 value which changes incrementally by itself too).
So another dead-end and I'm all out of ideas. Where else can I search?
I'm running SQL Server 2014. I have an insatiable thirst for internals knowledge and have yet to come across anything as elusive as this. It's caught my attention because in theory, it (an absolute value) is stored somewhere and should (arguably) be locatable. In my quest to unearth locations of internally stored data / meta data, this particular value strikes me as particularly elusive. I'm guessing/hoping that someone will come along and tell me, you can get it with
DBCC PAGE but I was looking in the wrong place.