Re: how to skip failed backup command?

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: bing (bing_at_discussions.microsoft.com)
Date: 07/13/04


Date: Tue, 13 Jul 2004 10:09:01 -0700

Thanks for the suggestion. Should 'with INIT' be used for all the three backup commands rather than just for the first one because db1, db2 and db3 each is backed up to their individual disk file? So it's something like this:

 Backup database db1 To db1 WITH INIT, name='db1_full'
go
Backup database db2 To db2 with init, with name='db2_full'
go
Backup database db3 To db3 with init, name='db3_full'
go

Bing

"Hari Prasad" wrote:

> Hi,
>
> Instead of procedure write the TSQL commands to backup the command and put a
> go in between.
>
> Backup database db1 To db1 WITH INIT, name='db1_full'
> go
> Backup database db2 To db2 with name='db2_full'
> go
> Backup database db3 To db3 with name='db3_full'
>
> You can schedule this using the SQL Agent -- Jobs. Just check I have not
> tried this.
>
> Thanks
> Hari
> MCDBA
>
>
> "bing" <bing@discussions.microsoft.com> wrote in message
> news:707643E2-3F80-4648-9968-A89D787940C5@microsoft.com...
> > I've created a stored procedure to backup several databases as shown
> below:
> >
> > CREATE PROCEDURE dbo.sp_fullbackup AS
> > Backup database db1 To db1 WITH INIT, name='db1_full'
> > Backup database db2 To db2 with name='db2_full'
> > Backup database db3 To db3 with name='db3_full'
> >
> > I noticed in the SQL server logs that if backing up db2 failed, db3 failed
> backing up as well or was not backed up at all. How should I tweak the
> above procedure so that if one db failed, it would not impace backing up its
> subsequent databases?
> >
> > Thanks in advance for any help,
> >
> >
> > Bing
> >
>
>
>