Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Re-using purged SQL records
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

65 Posts

Posted - 05/10/2013 :  09:48:28  Show Profile  Reply with Quote
For some reason our site generates about 20,000 anon customer ID's a week. We keep the numbers down by running a maintenance script to purge the ID's twice a week.

Our SQL customer numbers have grown rapidly, almost a million since Christmas. What I am wondering is is there a way to somehow use the old customer ID's? Not that we are going to run out any time soon but we have looked at every way of why this is happening but have found no logic behind it.

It seems a bit strange that we delete around 100,000 SQL rows from our customer dbo but cannot re-use them again. If anyone does know of a way I would be grateful.

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 05/10/2013 :  10:16:25  Show Profile  Reply with Quote
I would invest some time and efforts in identifying the reason for the rogue id's being generated (using SQL Trace, for example). That would cure the problem at the root.

If you do want to reuse the id's, (and here I am assuming you are referring to identity columns), there are ways to do it - See Peter Larsson's article here: If you do want to try evaluate the impact on business rules and other queries/code. Also, I have not tried the method described there, but usually Peter's articles are well thought out
Go to Top of Page

Flowing Fount of Yak Knowledge

United Kingdom
2179 Posts

Posted - 05/10/2013 :  13:44:13  Show Profile  Visit jackv's Homepage  Reply with Quote
How you generate the CustomerIDs - are they sql identity generated or custome generated?

Jack Vamvas
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000