4

Can I take a backup of a database in sql server developer edition?
I am running this code

backup database Test_db to disk = d:\DailyBackUp.

This code is running successfully but the folder DailyBackUp is still empty.

1
  • 1
    Is SQL Server running on your local machine?? If not: the backup will be created on the server machine's file system - NOT your local disk. Commented Sep 13, 2011 at 9:34

2 Answers 2

2

you have to specify the name of the backup

backup database Test_db to disk = d:\DailyBackUp\BackupFileName.Bak
Sign up to request clarification or add additional context in comments.

6 Comments

Msg 3201, Level 16, State 1, Line 1 Cannot open backup device 'd:\DailyBackUp\BackupFileName.Bak'. Operating system error 3(The system cannot find the path specified.). Msg 3013, Level 16, State 1, Line 1 BACKUP DATABASE is terminating abnormally.
it is looks like a security issue: make sure on that folder the account "Network Service" has got "Write" permission if you still have the error probably SQL is not able to write on your partition.To test is this is the issue try to backup on C: instead
@Peluso I have tried in c drive then also giving the same errors.Please help
make also sure the folder d:\DailyBackUp\ exist on your SQL Server machine
@Peluso How to check the Network Serveice.Please explain briefly
|
1

See my solution. Create 2 file 1/ BackupScript.sql

DECLARE @MyBackupName nvarchar(250)

SET @MyBackupName = 'C:\Projects\ABC\DB Backup\YouDBFileName_' + convert( varchar(10), getdate(), 112 ) + '.BAK'

BACKUP DATABASE [YouDBFileName] TO DISK = @MyBackupName WITH
NOFORMAT, NOINIT, NAME = N'DatabaseName-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10

2/ AutoBackup.bat

PATH = "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\" SQLCMD.EXE -S . -E -i "C:\Projects\ABC\DB Backup\BackupScript.sql"

Change your parameters if need Now you can run AutoBackup.bat and it auto create db backup like "YouDBFileName_20120325.bak"

1 Comment

You can create a schedule (Start menu->Accessories->System tool->Task Schedule) to do daily backup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.