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 July 5th, 2004, 04:52 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default sql server database backup by script

how can backup the sql database by the script ?

Please give example how can make the script that it
backup the databases (two database) ?
I want to use script in the job scheduling by run the script
weekly bases.

By the enterprise manager easily can take backup. but we want
backup perform automatically weekly.



Old July 5th, 2004, 04:58 AM
Registered User
Join Date: Nov 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Ramanuj Send a message via Yahoo to Ramanuj

BACKUP DATABASE { database_name | @database_name_var }
TO < backup_device > [ ,...n ]

Old July 5th, 2004, 11:17 PM
Authorized User
Join Date: Jun 2004
Posts: 54
Thanks: 0
Thanked 1 Time in 1 Post

hi Mateen,

If you want backup operation to be happened automatically then you can have one more option provided by sql server itself. "Scheduler". By using Schedule backup task whatever span you want to specify you can for backup operation.

Provided you SQL Server Agent running all the time. When you schedule something. it gets added as a Job in "Management > Sql Server Agent > Jobs" in Enterprise Manager. You can even change the job from there also.

Vinod Pawar
Software Developer
Old July 6th, 2004, 05:15 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts

thanks for response.

backup by schedule is good, but for this, you have to Access (enter) the
enterprise menager with rights. I want that I write script and run it make
backup the database. just like in Oracle. In Oracle write script in text file
database startup nomount
start backup
path etc...........

database mount
end backup

just like this. without accessing Enterprise Manager,
script run and make backup at defind path of hard disk.
it is possible in sql server 2000 ?



Old July 6th, 2004, 12:32 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post

Hi Mateen,

Then you will have to look for BACKUP DATABASE command on BOL and use it accordingly, as Ramanuj suggested.


- Vijay G
Strive for Perfection

Similar Threads
Thread Thread Starter Forum Replies Last Post
How i can Backup and Restore Sql Server Database hamor ASP.NET 2.0 Professional 1 April 24th, 2007 07:03 AM
How to Backup database - SQL Server 2000 cancer10 SQL Language 2 March 1st, 2007 07:21 AM
How to take SQL Server Database Backup via .NET?? savan_thakkar ASP.NET 1.0 and 1.1 Professional 9 February 22nd, 2006 08:01 AM
SQL Server 2000 backup from command line vmaruv SQL Server 2000 3 February 3rd, 2005 07:54 PM
SQL Server Backup Restore zaeem Classic ASP Databases 0 December 4th, 2003 09:02 AM

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