Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 sql server 2008 backups

Author  Topic 

info999
Starting Member

4 Posts

Posted - 2011-03-16 : 11:11:57
I am attempting to backup some small databases hosted online. The backups should be onto my local computer.
I can connect to the online database and run queries against them.
But any attempts to backup the databases just don't seem to work. SQL Server seems to complete the backup almost instantly but the backup files are nowhere to be found.
Any ideas of what I am doing wrong please.

DaleTurley
Yak Posting Veteran

76 Posts

Posted - 2011-03-16 : 11:25:53
What location are you backing it up to?
If you are connected to the server and back the database up to C:\Backup.bak - backup.bak will be placed on the C: drive of the server, not your laptop.
Go to Top of Page

info999
Starting Member

4 Posts

Posted - 2011-03-16 : 12:00:47
Thanks Dale, that was what I suspected but I would have expected an error since I am not supposed to have write permission on the server !
How do I specify that the DB is backed up on my local computer?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-03-16 : 12:55:33
You'll need to provide a UNC path.

BACKUP DATABASE db1
TO DISK = '\\yourServer\someShare\someDir\db1.bak'
WITH INIT

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-03-16 : 13:07:50
quote:
Originally posted by info999

Thanks Dale, that was what I suspected but I would have expected an error since I am not supposed to have write permission on the server !



Your permissions are irrelevant here. SQL Server has permissions to that location and it is what it doing the writing

--
Gail Shaw
SQL Server MVP
Go to Top of Page

info999
Starting Member

4 Posts

Posted - 2011-03-16 : 19:44:22
Thanks Gail and Tara.
I didn't know about UNC paths! I have done a lot of SQL Server programming but never any admin work!
I assume that I can use a UNC path to backup the data on the server to my computer.
I tried a path \\ME\db\backups\db1.bak which specifies my local SQL Server and is an existing directory path but it doesn't get recognized.
At the moment I am using the tasks and Backup options
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-03-17 : 04:12:55
Just bear in mind that to do that, the account that SQL is running under needs write permissions to directories on your machine. If proper security is in use, it won't have that.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -