SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

deanglen
Yak Posting Veteran

64 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

3593 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: http://www.sqlteam.com/article/efficiently-reuse-gaps-in-an-identity-column 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

jackv
Flowing Fount of Yak Knowledge

United Kingdom
2047 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
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.09 seconds. Powered By: Snitz Forums 2000