Re: SQL Differential Backups



Dear Andrew, Thanks for all your help, I'm almost there.

I type in this command and get a 156 error near keyword WITH

My command;

DECLARE @DBNAME VARCHAR(40), @DEVICE VARCHAR(200), @NAME VARCHAR(200)
SET @DBNAME = 'GOLDMINE_SALES_AND_MARKETING'
SET @DEVICE = N'F:\SQL2000\GOLDMINE_SALES_AND_MARKETING\' + @DBNAME +'_FULL'
+ CONVERT(NVARCHAR(16),GETDATE(),112) + N'.BAK'
SET @NAME = @DBNAME + N' FULL BACKUP'
BACKUP DATABASE @DBNAME TO DISK = @DEVICE WITH INIT , NOUNLOAD , NAME=
@NAME, NOSKIP , STATS = 10, NOFORMAT WITH DIFFERENTIAL


"Andrew J. Kelly" wrote:

> You can do something like this example. Tailor it to your needs:
>
> DECLARE @DBName VARCHAR(40), @Device VARCHAR(200), @Name VARCHAR(200)
> SET @DBNAME = 'YourDBName'
>
> SET @Device = N'C:\Data\Backups\' + @DBName + '_Full_' +
> CONVERT(NVARCHAR(16),GETDATE(),112) + N'.BAK'
>
> SET @Name = @DBName + N' Full Backup'
>
> BACKUP DATABASE @DBName TO DISK = @Device WITH INIT , NOUNLOAD ,
> NAME = @Name, NOSKIP , STATS = 10, NOFORMAT
> WITH DIFFERENTIAL
>
>
> --
> Andrew J. Kelly SQL MVP
>
>
> "Don Hofer" <DonHofer@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:43F8D75D-78A1-4962-A9BE-B0ED7A0BABD4@xxxxxxxxxxxxxxxx
> > Andrew, it did run. I refreshed the screen and a differential ran at 0800
> > in
> > the morning. I also see the job in the Jobs under SQL Server Agents.
> > I write all jobs our to a Raid, and they have that raid xfered to another
> > server and to tape. Both the Daily and Trans backups, run with the name
> > of
> > the database followed by the date and time ran and an extension of ".trn"
> > or
> > ".Bak"
> > Is there a way to get the Differentials to run the same way?
> >
> > "Andrew J. Kelly" wrote:
> >
> >> What exactly do you mean when you say you can't get them to run? Do you
> >> get
> >> errors?
> >>
> >> --
> >> Andrew J. Kelly SQL MVP
> >>
> >>
> >> "Don Hofer" <DonHofer@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> news:AF59E550-A74B-4ED4-8661-67F7B110D00D@xxxxxxxxxxxxxxxx
> >> > In our Maintance plans, we have our full daily backup running fine, and
> >> > our
> >> > Transactions running fine, i.e every 30 minutes.
> >> > We can perfrom manual Differential backups fine. We just can not get
> >> > the
> >> > Differential backups to run out of the schuduler.
> >> > We're trying to achive, Differentials every 4 hours, with Transactions
> >> > every
> >> > 30 minutes inbetween.
> >> > Any help will be most appreciated.
> >>
> >>
> >>
>
>
>
.



Relevant Pages

  • Re: Error when rebuild table index
    ... Since my SQL Server is ... The job command is as follows. ... "Andrew J. Kelly" wrote: ... >> Rebuilding indexes for table 'cliStores' ...
    (microsoft.public.sqlserver.tools)
  • Re: different environment fails to fill a dataset
    ... successfully ran the select command with no problems. ... Andrew J. Kelly SQL MVP ... Is there anything in the environment or SQL Server that could be ...
    (microsoft.public.sqlserver.clients)
  • Re: [Announce] Angband User Interface Patch
    ... >>> Hi Andrew, ... >>This is how the Unangband implementation does it. ... > an item when issuing the handle command, ... but floor items were a headache - the various ...
    (rec.games.roguelike.angband)
  • Re: SQL Differential Backups
    ... > Dear Andrew, Thanks for all your help, I'm almost there. ... >> Andrew J. Kelly SQL MVP ... I also see the job in the Jobs under SQL Server Agents. ... >>> Is there a way to get the Differentials to run the same way? ...
    (microsoft.public.sqlserver.setup)
  • Re: View jobs status
    ... > are Public in the MSDB they should have no problem seeing the results. ... > Andrew J. Kelly SQL MVP ... >> I need to give a SQL user some kind of database access to view the jobs ...
    (microsoft.public.sqlserver.server)