473,839 Members | 1,371 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SS 2000 Backup programatically

Hi,
I am writing a remote update app, and I'd like to programmaticall y backup
the SQL Server 2000 database before running the SQL files over it.
Can anyone tell me a command that does a hot backup of the DB and puts it
somewhere, which I would shell exec from my program.

eg
ShellExec("hotb ackup mydb c:\tmp\backups\ todaysBackup.ba k")

I'm not concerned with how long it takes to restore. ie preferably a quick
backup and if necessary a long restore.
Cheers,
Dirk
Jul 20 '05 #1
7 5602

"Dirk McCormick" <di**@acquirer. nospam.com> wrote in message
news:9d******** *************** *******@news.me ganetnews.com.. .
Hi,
I am writing a remote update app, and I'd like to programmaticall y backup
the SQL Server 2000 database before running the SQL files over it.
Can anyone tell me a command that does a hot backup of the DB and puts it
somewhere, which I would shell exec from my program.

eg
ShellExec("hotb ackup mydb c:\tmp\backups\ todaysBackup.ba k")
You do it from within SQL Server.

Look for backup database in Books On-Line.


I'm not concerned with how long it takes to restore. ie preferably a quick
backup and if necessary a long restore.
Cheers,
Dirk

Jul 20 '05 #2
> > I am writing a remote update app, and I'd like to programmaticall y
backup
the SQL Server 2000 database before running the SQL files over it.
...
You do it from within SQL Server.

Look for backup database in Books On-Line.

Actually I want to do it from within the remote update program, ie
automatically, no user intervention.
The program downloads sql scripts from the internet, and runs them over the
database. So before this happens, I want the program to backup the database
from code.

eg

getSQLFiles();
ShellExec("hotb ackup mydb c:\tmp\backups\ todaysBackup.ba k", ...);
executeSQLFiles ();

An online search for how to backup SQL server only gives me manual methods
and training courses. I am assuming, perhaps incorrectly, that there is
command line utility that can do hot backups.
Cheers,
Dirk
Jul 20 '05 #3

"Dirk McCormick" <di**@acquirer. nospam.com> wrote in message
news:da******** *************** *******@news.me ganetnews.com.. .
I am writing a remote update app, and I'd like to programmaticall y backup the SQL Server 2000 database before running the SQL files over it.
...
You do it from within SQL Server.

Look for backup database in Books On-Line.

Actually I want to do it from within the remote update program, ie
automatically, no user intervention.
The program downloads sql scripts from the internet, and runs them over

the database. So before this happens, I want the program to backup the database from code.
Right. You write the backup command as a script and execute that as you
would your other scripts.

No human intervention required.

eg

getSQLFiles();
ShellExec("hotb ackup mydb c:\tmp\backups\ todaysBackup.ba k", ...);
executeSQLFiles ();

An online search for how to backup SQL server only gives me manual methods
and training courses. I am assuming, perhaps incorrectly, that there is
command line utility that can do hot backups.
Cheers,
Dirk

Jul 20 '05 #4
> Right. You write the backup command as a script and execute that as you
would your other scripts.

No human intervention required.


I suppose I could write a script to copy the existing tables to temporary
tables, but I would prefer to actually output the data to a file.
Is this what you mean, or do you mean send SQL commands that backup the
database? (eg "BACKUP DBNAME TO <FILEPATH>")
I don't know of any such commands, but if there are this solution would be
fine.
I should point out by the way that the SQL scripts I'm running are not
PL/SQL or any other SQL programming script, just plain old DDL and SQL
As you may have gathered I don't know much about databases, so pretend
you're talking to a novice =)

Thanks for your help.
Dirk
Jul 20 '05 #5
>> Right. You write the backup command as a script and execute that as you
would your other scripts.

No human intervention required.


I suppose I could write a script to copy the existing tables to temporary
tables, but I would prefer to actually output the data to a file.
Is this what you mean, or do you mean send SQL commands that backup the
database? (eg "BACKUP DBNAME TO <FILEPATH>")
I don't know of any such commands, but if there are this solution would be
fine.
I should point out by the way that the SQL scripts I'm running are not
PL/SQL or any other SQL programming script, just plain old DDL and SQL
As you may have gathered I don't know much about databases, so pretend
you're talking to a novice =)

Thanks for your help.
Dirk


There is a backup database command that you can
run thru Tsql. Here is what is in the Tsql online documentation.

-- Create a logical backup device for the full MyNwind backup.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwind_1',
DISK ='c:\Program Files\Microsoft SQL Server\MSSQL\BA CKUP\MyNwind_1. dat'

-- Back up the full MyNwind database.
BACKUP DATABASE MyNwind TO MyNwind_1


Randy
http://members.aol.com/rsmeiner
Jul 20 '05 #6
Perfect.
Thanks!
dirk
There is a backup database command that you can
run thru Tsql. Here is what is in the Tsql online documentation.

-- Create a logical backup device for the full MyNwind backup.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwind_1',
DISK ='c:\Program Files\Microsoft SQL Server\MSSQL\BA CKUP\MyNwind_1. dat'
-- Back up the full MyNwind database.
BACKUP DATABASE MyNwind TO MyNwind_1

Jul 20 '05 #7
"RSMEINER" <rs******@aol.c omcrap> wrote in message
news:20******** *************** ****@mb-m14.aol.com...
Right. You write the backup command as a script and execute that as you would your other scripts.

No human intervention required.
I suppose I could write a script to copy the existing tables to temporary
tables, but I would prefer to actually output the data to a file.
Is this what you mean, or do you mean send SQL commands that backup the
database? (eg "BACKUP DBNAME TO <FILEPATH>")
I don't know of any such commands, but if there are this solution would befine.
I should point out by the way that the SQL scripts I'm running are not
PL/SQL or any other SQL programming script, just plain old DDL and SQL
As you may have gathered I don't know much about databases, so pretend
you're talking to a novice =)

Thanks for your help.
Dirk


There is a backup database command that you can
run thru Tsql. Here is what is in the Tsql online documentation.

-- Create a logical backup device for the full MyNwind backup.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwind_1',
DISK ='c:\Program Files\Microsoft SQL

Server\MSSQL\BA CKUP\MyNwind_1. dat'
-- Back up the full MyNwind database.
BACKUP DATABASE MyNwind TO MyNwind_1


You dont need to add a dump device, you can backup direct to a file :-

BACKUP DATABASE MyNwind to disk = 'c:\Program Files\Microsoft SQL
Server\MSSQL\BA CKUP\MyNwind_1. dat'

Ian.
Jul 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4330
by: trotter | last post by:
I want to know if there is a "best-practice" for setting up Database Maintenance Plans in SQL Server 7 or 2000. To be more specific, I want to know the order in which I complete the tasks. Do I complete optimization first, then integrity checks, then translog backup, then full backup??? OR is there a better order which should be used? Should I ALWAYS backup the transaction Log before I complete a full database backup, and if so, why?? ...
2
5964
by: Chirath Fernando | last post by:
Hi We are running SQL 2000 Enterprice version with SP3a on a Dell Poweedge 5600 server running Advance Server. It has Tape drive PowerVault 110T (DLT VS80 Tape Drive) & uses DLT tapeIV tapes. A DB maintenance job had been specified to backup on to tape daily. I have following issues; 1.The backup job sometimes fails with the following error in Event log(Event ID:17055)
10
3157
by: Dirk McCormick | last post by:
Hi, I am writing a remote update app, and I'd like to programmatically backup the SQL Server 2000 database before running the SQL files over it. Can anyone tell me a command that does a hot backup of the DB and puts it somewhere, which I would shell exec from my program. eg ShellExec("hotbackup mydb c:\tmp\backups\todaysBackup.bak") I'm not concerned with how long it takes to restore. ie preferably a quick
1
1897
by: kg7poe | last post by:
I'm trying to install SQL server 2000 inside SBS 2000. Actually I think I already did it. I just don't know how to run/start it up. I want to upgrade my SQL 6.5 database backup into 2000. I have the book SQL Server 2000 Administration by SYBEX. Here is what I need to know: The best book on installing SQL 2000 under SBS2000 for a beginner
2
1786
by: Robert Kruk | last post by:
Hello, Recently I've tried to restore backup made on SQL Server 6.5. Unfortunately, the only version of SQL Server I currently possess is SQL Server 2000. I have access only to that backup, because I've made it a few years ago, and the main db file doesn't exist any more ;( I would be grateful if you could help me a little ;) Regards R.Kruk
6
3127
by: A.Y. Xu | last post by:
Environment: Win Server 2003 Standard Version, SQL Server 2000, HP DDS3 Tape(local). Backup procedure: 1. open SQL Server Enterprise Manager 2. find the database i want to backup 3. right click and select "All Tasks"-"Backup Databse..." 4. Select "destination"-"backup to"-->>"Tape" 5. Click "Add", Select "Tape" device name(or may address)"\\.\Tape0" 6. Click "OK" begin to backup
3
2234
by: datapro01 | last post by:
I am a DB2 DBA that has been asked to become familiar enough with SQL Server in order to become actively involved in its installation, implementation, and to review database backup/recovery procedures. SQL Server will be used by a vendor packaged application. The problem is that we are awaiting word on whether it will be SQL Server 2000 or 2005 we will be working with. I have been told that there are considerable differences between the...
1
2378
by: Robbert van Geldrop | last post by:
Hello, I have a problem restoring Exchange 2000 files. Our software has an interface to ESEBCLI2.dll for online backup and restore features. Everything works fine with Exchange 2003 and also when backing up Exchange 2000, yet restoring Exchange 2000 gives some problems: A Store is restored: * the restore is started.
9
7816
by: dpatel75 | last post by:
I am trying to copy a database from a SQL 2000 SP3 Windows 2000 server to a 2005 SP2 Windows 2003 server. I am trying to use detach and attach method (have tried both within Management Studio and T-SQL) and experience an error when attaching to the 2005 server: "CREATE FILE encountered operating system error 5 (error not found) while attempting to open or create the physical file 'xxxxxxxxxxxx' (Microsoft SQL Server, Error: 5123)" I have...
0
9697
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10586
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10648
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10293
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7828
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7017
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4484
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3134
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.