• Hi,

    Its a great script. We use this stored proc to loop through all the databases in another stored procedure.

    I have used like this

    SP_MSFOREACHDB 'EXECUTE DBO.USP_DBBackup ''full'',''?'',''E:\sqlbackups'',''1'',1'

    My suggestion are.

    1. The stored proc needs to check the avaibility of the databases(online, offline, recovering,etc..)

    2. Check if the database is involved in logshipping. Otherwise we may break the lsn continuity by taking log backups.

    3. We can make it general script for 2000 and 2005 by adding IF ELSE Blocks for 2000 and 2005

    I would modify the stored proc IF @@VERSION LIKE 'Microsoft SQL Server 2000%'

    But overall its a great script.

    Thanks and regards,

    Vee