dcsimg
Results 1 to 5 of 5

Thread: Hoping someone can help with scripting this...

  1. #1
    Join Date
    Feb 2006
    Posts
    2

    Hoping someone can help with scripting this...

    Novice when it comes to SQL...

    We have a number of databases we need to weekly shrink...yes, I know that more drive space would be the best thing, but that is not practical, at this time...

    we do a query on each db as such..
    DUMP TRAN (db) With NO_LOG (yes, I know...we back them up nightly)
    dbcc updateuseage (db)

    after doing this for each db, we then run a shrink on each one...

    What I would like to do is to somehow script this activity, to run easily and not so tediously...

    Can anyone help?
    Thanks!

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Auto shrink option doesn't work?

  3. #3
    Join Date
    Feb 2006
    Posts
    2

    auto shrink?

    Again, a newbie...can you explain how to auto shrink?

  4. #4
    Join Date
    Jan 2006
    Location
    USA
    Posts
    19
    When the AUTO_SHRINK option has been set to ON, the Database Engine automatically shrinks databases that have free space.
    AUTO_SHRINK ON | OFF
    If ON is specified, the database files are candidates for automatic periodic shrinking.

  5. #5
    Join Date
    Sep 2002
    Posts
    5,938
    You can set that by right click the db in enterprise manager and go to properties -> options tab, check auto shrink.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •