Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 24th, 2005, 10:50 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default Back Up DataBase Syntax (Jobs)

I have the following statement being run in an SQL Server 2000 Job:

Backup Database DBName To Disk='C:\Path\DBName.bak'

Every time this runs it appends to the existing file (the last scheduled backup) This makes the file size grow and grow and grow.Eg if the first .bak file was 10Mb the next back up will push the file size to 20Mb even though there has been no more data in the tables. Can I alter this statement to replace or overwrite the existing file?

Thank you in advance

Wind is your friend
Matt
__________________
Wind is your friend
Matt
 
Old October 25th, 2005, 07:24 AM
Authorized User
 
Join Date: Sep 2005
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Take a look at EXPIREDATE and RETAINDAYS in BOL for Backup Database

“I sense many useless updates in you... Useless updates lead to defragmentation... Defragmentation leads to downtime...Downtime leads to suffering..Defragmentation is the path to the darkside.. DBCC INDEXDEFRAG and DBCC DBREINDEX are the force...May the force be with you" -- http://sqlservercode.blogspot.com/
 
Old October 25th, 2005, 06:51 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

If I am creating a job using EM. Are these properties avaibale to me? The way I am reading them they are not.

Is it possible to create a 'scheduled job' using EM that overwrites the last .bak file

TYIA

Wind is your friend
Matt
 
Old October 26th, 2005, 06:30 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Here is the solution for anyone interested:

The INIT is what did it

BACKUP DATABASE [DBName] TO DISK = N'C:\Inetpub\wwwroot\path\DBName.bak' WITH INIT , NOUNLOAD , NAME = N'SomeName', NOSKIP , STATS = 10, NOFORMAT

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
what is the right back end database for PHP? charliemears PHP Databases 1 May 21st, 2008 03:44 PM
Writing back to the Database angieb1008 VB Databases Basics 0 January 4th, 2007 06:00 PM
saving table of information back into database mrjits Excel VBA 3 July 17th, 2006 01:42 PM
forum have back-end database? abdul_wasie SQL Server 2000 1 May 9th, 2005 09:11 AM
Queries on Back End database? gazolba Access 3 May 1st, 2004 11:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.