Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do you recycle records in SQL Server?
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01306687
Message ID:
01306692
Views:
4
>>Hi everybody,
>>
>>In my VFP application I have a routine that deletes a bunch of records in a table and then has to create a bunch of records. To minimize the number of records marked as deleted I recycle records. Basically instead of deleting records I mark them in a field REC_STAT as "AVAILABLE" and when I need to add records I first check if "AVAILABLE" records exist and overwrite values there. This routine is kind of pain to maintain but I have learned to live with it.
>>
>>Now I am converting this routine to SQL Server. Is it going to be a problem for SQL Server if I don't recycle deleted records. That is, if I simply delete when I need to delete and create new when I need to create new. I don't know if SQL Server automatically packs tables or it has to be done in a separate routine as done in VFP. To give you a ball park number of records/rows in this table is as following:
>>Maximum number of records 500,000
>>Percent deleted would be about 10%.
>>The above are real guess number and considerably larger than my typical customer database. But I wanted to know the worst impact of this situation.
>>
>>Thank you in advance for any input.
>
>When you delete record in SQL Server it is deleted. There is now way to get it back. No need to PACK (and there is no such command in SQL Server).
>SQL Server maintains it own recycle routine and uses the place from already deleted records when you add new ones.
>It is up to you if you want to get rid of MARK records and then re-use them or leave all to SQL Server.

From what you are telling me, I can get rid of my "recycle" routine and delegate recycling to SQL Server. This will make my code better.

Thank you very much!
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform