Backup & Restore Database SQL Server 2000

This time i’d like to share about how to backup and restore database while user still online or something that client still active. Usually even client already close his application but in SQL Server 2000 still show that client connected to database. You won’t succeeded while you’re trying to Restore Database.

Here’s some sample script that you can run on Enterprise Manager or you can build your own Backup & Restore Application module.

Backup :

BACKUP DATABASE [dbBillingAMAG]
TO
DISK = ‘C:\Data\Microsoft SQL Server\MSSQL\BACKUP\dbBilling\dbBilling_backup1.BAK’
WITH
NOFORMAT,
NOINIT,
NAME = ‘dbBilling backup’,
NOREWIND,
NOUNLOAD,
SKIP

Restore :

USE MASTER
RESTORE DATABASE [dbBillingAMAG]
FROM
DISK = ‘C:\Data\Microsoft SQL Server\MSSQL\BACKUP\dbBillingAMAG\dbBillingAMAG_backup1.BAK’
WITH
FILE = 1,
NOREWIND,
NOUNLOAD,
REPLACE

*Note :

If you didn’t syntax “USE MASTER” you will get message from SQL server like this message “Error: Failed: Exclusive access could not be obtained because the database is in use“.

Bookmark and Share

About Andi Eko

This blog talk about any information about Technology and Business. This is the part of my journey surfing the Jungle of Internet when people got many information from there and I tried to collected it, not all but some of interested articles. Enjoy the show.
This entry was posted in SQL Server 2000. Bookmark the permalink.

2 Responses to Backup & Restore Database SQL Server 2000

  1. Medifast says:

    Word press advises that you do this every so often so that you don’t lose information on your blog….but I still don’t know how to back up!

  2. Andi Eko says:

    If you’re using WordPress you can regularly backup at Tools WordPress Admin.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>