1
votes

I am trying to create a back up for an SQL Server database using command line.I have used the following command:

C:\>SqlCmd -E -S DEVE-PC3/SQLEXPRESS -Q "BACKUP DATABASE Exam_Db To Disk='d:\Exam_db.bak'"

But I am getting an error message

Msg 3201,cannot open backup device Operating System Error 5.
Msg 3013,Backup database is terminating abnormally.

What am I missing?

1

1 Answers

2
votes

That error message tells you that whatever account is running the SQL Server service doesn't have permission to write to the location that you've specified. Either choose another location or give the service account permission.