Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Help!!Compacting Database MSDE/SQL

Help!!Compacting Database MSDE/SQL

Scheduled Pinned Locked Moved Database
databasesql-serversysadminhelptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jfk_lili
    wrote on last edited by
    #1

    Hi Guys, I have not known so much about the SQL Server and MSDE, so just rush to here to get help. Can any one tell me When records are deleted, is the space immediately compacted or when is it compacted? and Is the compacting configurable? How to set it up? Since I am using the SQL buddy For large number of records deleted (eg. Archival), is the database compacted immediately! Many thanks in advance! I am really appreciate your help.

    M 1 Reply Last reply
    0
    • J jfk_lili

      Hi Guys, I have not known so much about the SQL Server and MSDE, so just rush to here to get help. Can any one tell me When records are deleted, is the space immediately compacted or when is it compacted? and Is the compacting configurable? How to set it up? Since I am using the SQL buddy For large number of records deleted (eg. Archival), is the database compacted immediately! Many thanks in advance! I am really appreciate your help.

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      SQL Server does not generally compact free space. To do so, use the Shrink feature (in T-SQL, DBCC SHRINKDATABASE). To have this occur automatically, set the 'Auto Shrink' option. You can do this in T-SQL with ALTER DATABASE db SET AUTO_SHRINK ON. MSDE has this option turned on by default. If Auto Shrink is set, the shrinking operation occurs when there is more than 25% free space in the file. The resulting file will have 25% space free or be the size it was when originally created, if that is larger. Stability. What an interesting concept. -- Chris Maunder

      J 1 Reply Last reply
      0
      • M Mike Dimmick

        SQL Server does not generally compact free space. To do so, use the Shrink feature (in T-SQL, DBCC SHRINKDATABASE). To have this occur automatically, set the 'Auto Shrink' option. You can do this in T-SQL with ALTER DATABASE db SET AUTO_SHRINK ON. MSDE has this option turned on by default. If Auto Shrink is set, the shrinking operation occurs when there is more than 25% free space in the file. The resulting file will have 25% space free or be the size it was when originally created, if that is larger. Stability. What an interesting concept. -- Chris Maunder

        J Offline
        J Offline
        jfk_lili
        wrote on last edited by
        #3

        Hi Mike, Thanks very much for your reply. So the compacting is a default option which already be turned on in MSDE? How about SQL Server, the option is also turned on by default? Is there any way I can configure this option so that it can be performed when there is 10% free space? Many thanks for your help!!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups