• amit hollenberg (1/17/2008)


    Very nice backup script ,

    it will be nicer if it will be wrapped in a cursor or some kind of a loop that will backup all the Database in the instance not just specified database.

    best regard Amit Hollenberg.

    See Vee's post - you can use sp_MSforeachdb. Note - that is an undocumented system stored procedure, so may not be around in future versions of SQL (so sayeth Microsoft).

    The reason I did it this way was so you could have granularity - if you only wanted to backup a few of the databases, you could, rather than all or nothing. It wouldn't be too hard to add that functionality though, so I'll look into it.



    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