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

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Re-using purged SQL records

Author  Topic 

deanglen
Yak Posting Veteran

65 Posts

Posted - 2013-05-10 : 09:48:28
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
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-05-10 : 10:16:25
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
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2013-05-10 : 13:44:13
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
   

- Advertisement -