We just moved to a new image-storage method for our application, which means we don't need to store image byte arrays in the database any longer.
To that end, I have deleted (via an UPDATE
statement) about 19k byte arrays containing hi-res images (about 8 GB) from a column in a single table. Without the images, I do not expect the database to ever grow back to the size it is now. Again, please note that I did not delete rows here, but have only set field values to NULL.
Other Info:
- The column type was VARBINARY
- There was no index on the column.
Questions
- Should I just go ahead and shrink the database, then rebuild indexes for that table?
- Most scenarios I read involve shrinking after a
DELETE
statement. I didn't delete any rows, I only set the field value to null for all rows. Does this change anything? - The column is now deprecated and we may want to just delete it from the table; I believe this will require the table to be recreated. Should I shrink the database before or after I delete the column?
Edit: Another possibility just occurred to me. With the image data gone, it might be better to just write a script to completely rebuild the entire database, without the column image column. Thoughts?