Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query for DB Backup.

Status
Not open for further replies.

hmdeassis

MIS
May 18, 2000
55
US
Ok.

Here is the scenario:

I have a SQL DB hosted by my ISP. I need to know if there is a SQL query that I can run that it will back up or copy the entire locally into my system. My ISP does not have any tools that I can use to make a DB backup, since it is a shared host.

Any suggestion would be greatly appreciated.

Thx
 
The BACKUP DATABASE TO DISK='path\filename.bak' SQL command can be used to take a backup to disk on their server. However, unless you have a way of copying the resulting file to your PC then there's not much point in using it.

John
 
Do you know what command do I use for this backup? I need the sql query please.

Thank you.
 
BACKUP DATABASE databasename TO DISK='d:\path\filename.db.bak'

then

BACKUP LOG databasename TO DISK='d:\path\filename.log.bak'

Note that this needs to be a writable location - and it will be on the server's - not your PC's hard drive.
Therefore you will still need some method of transferring the database and log file backup to your PC, where you can use the RESTORE DATABASE and RESTORE LOG SQL commands or enterprise manager to put them into your SQL server.

For more information, search for the commands in Books online.

John

 
Thank for the great info John. I'll test it out and let you know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top