Shrinking TEXT fields

  • I have a database using very large strings that I stuck in TEXT fields. Eventually I noticed that there was a lot of unnecessary white space in the strings.

    I wrote a small program to strip out the whitespace and update the TEXT fields. According to my program's counter the resulting TEXT fields should have been about 500M smaller, yet the free space listed for the database has actually gone down.

    Any ideas?

  • the freespace will just get larger as you cleanup your data, until you shrink the database...when you shrink the database, only then will the actual amount used get smaller. until then, the space continues to be reserved for more data, that you may or may not use.

    it's similar to tempdb...big queries make the temp database grow, and it doesn't get smaller...until

    you stop and start the server....tempdb gets recreated at that time with the default space it is supposed to use.

    a normal database never gets recreated, so it stays it's maximum size so far unless explicitly shrunk by the dba.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply