Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 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, 09:53 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 How to make a job overwrite and not append

I can not make a job that overwrites an existing file. Everytime the job runs the file size get out of control.

1..I am using the job wizard in EM to create the job.
2..Using Transact SQL Command:
Backup Database DBName To Disk='C:\MyPath\DBName.bak'
3..Scheduling it to run once a day in the evening

It is all running fine and backs up as it should. How can I make it replace the file each time. My objective is to have one file in this dir and for it to be overwritten each time. I can not find a way to stop the file size growing.

Thank you in advance

Wind is your friend
Matt
__________________
Wind is your friend
Matt
 
Old October 25th, 2005, 01:42 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you want the "init" option of the backup command. It's in the help files that come with SQL.

 
Old October 25th, 2005, 06:23 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

I wil look for it, have you used it?

Wind is your friend
Matt
 
Old October 26th, 2005, 06:14 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
 
Old October 28th, 2005, 04:03 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the follow up message, sorry I was unplugged from the web for a few days to reply to your previous post.

gday mate!!!






Similar Threads
Thread Thread Starter Forum Replies Last Post
dsshost.exe overwrite during example code install Noyabronok BOOK: Professional Microsoft Robotics Studio ISBN: 978-0-470-14107-6 1 August 23rd, 2008 05:01 PM
Overwrite user page setup for printing peter2004 CSS Cascading Style Sheets 8 December 17th, 2007 05:51 PM
Problem:overwrite cookies?! al-hijjawi ASP.NET 1.0 and 1.1 Basics 0 April 12th, 2006 06:15 AM
Make Table & Append Querys lryckman Access 1 January 25th, 2006 05:38 PM
How to overwrite local files? bramtram VB How-To 4 August 18th, 2003 08:06 PM





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