Home > ETL Best Practices > LastId Dilemma – Resolved Finally

LastId Dilemma – Resolved Finally

We just need to understand what a commercial software’s Last Id strategy is and how they implement it.

First of all, we understand that the Last Id is THE Last ID that covers all the SQL tables, and there is no Last Id for any specific SQL table.

After some help from their developers, a stored procedure of GetId() was identified.


This  leads to the LastId table, which has an Identity column with 6706 as the seed value:


Use the DBCC command to get the actual seed value. It is still 6706,

DBCC checkident(LastId, noreseed)

This gives us a starting ID value of 1 + 6706 * 30 = 201,181. To increase our starting ID value, we just need to increase the seed value for the LastId table.

To increase the starting ID to 4,000,000, re-seed the LastId table:

DBCC checkident(LastId, reseed, 133333)

Done. Problem solved.

Categories: ETL Best Practices
  1. No comments yet.
  1. February 18, 2011 at 7:06 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: