Backup Stored Proc

  • OK, a new version. This has tidied up a couple of things that were annoying me.

    I have also added the ability to perform FILE or FILEGROUP backups. This only works if you specify a single database name. You can specify multiple files or filegroups. Supports FULL and DIFFERENTIAL backups for all.

    I [believe I] have fully tested it, but there's always a chance I have missed something. If you have any problems, let me know.



    Scott Duncan

    MARCUS. Why dost thou laugh? It fits not with this hour.
    TITUS. Why, I have not another tear to shed;
    --Titus Andronicus, William Shakespeare


  • Scott,

    This is an awesome script. I use it on my SQL Server to backup our production DB full weekly, incremental nightly, and transaction log every 5 minutes.

    However, do you have an analog to RESTORE the database? We have a reporting instance that we used to refresh nightly from production, but now that I don't do a full DB backup every night my existing SQL Server job can't run, so I'm forced to (for now) restore the incremental by hand every day.

    I'm comfortable scripting another proc to be in sync (e.g. every Monday morning restore the full DB, every other day restore the incremental) but the part that I'm having trouble with is determining which incremental to pick up (since it's some sort of random number appended to the file name)...

    In theory, I'd want to get the most recent full or incremental backup when running the restore, e.g.:

    restore 'MYDB', 'FULL', 'P:\ath\to\backups', 'somedate' = null

    if the date was entered, look for the most recent full on that date otherwise pick the most recent full in the dir...

    Thoughts?

  • I'm a total n00b to SQL, we received SQL2000 as database server backend with accounting software and frankly speaking, looking at the complexity of this stuff, it will not be my hobby :))

    However, the need for a backup is there so i found this script. Is anyone running this on SQL 2000 SP4? I tried the script by starting Enterprise Manager, follow the path

    Microsoft SQL Servers -> SQL Server Group -> (local) (Windows NT) -> Databases -> master -> Stored Procedures and then choosing new stored procedures. I copied the entire contents of the backup scripts version 3 a few posts up. I think i need to replace the NULL parameters with some of the things i needed to decide on. So i did that, when i click on OK i get a huge error message (so long it doesn't fit my screen) with all sorts of "Need to define" and then a variable name.

    What am i doing wrong?

Viewing 3 posts - 16 through 17 (of 17 total)

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