Doubt with Script to Generate Sql Server 2014 Database Backup

Asked

Viewed 158 times

2

I’m doing it this way:

USE CEP_2014_09;
GO
BACKUP DATABASE CEP_2014_09
TO DISK = 'C:\Backup_teste\CEP_2014_09.bak'
   WITH FORMAT,
      MEDIANAME = 'z_CEP_2014_09',
      NAME = 'Full Backup of CEP_2014_09';
GO
Mensagem 3201, Nível 16, Estado 1, Linha 1
Cannot open backup device 'C:\Backup_teste\CEP_2014_09.bak'. Operating system error 3(The system cannot find the path specified.).
Mensagem 3013, Nível 16, Estado 1, Linha 1
BACKUP DATABASE is terminating abnormally.
  • This folder exists: C: Backup_test?

  • Yes, he does exist,

  • Make sure it is not permission problem using another write address. Example TO DISK = 'C: Users<seu_usuario> CEP_2014_09.Bak'.

  • 1

    I will ask again why it is not clear whether this folder exists on the server or on your machine. If that database is on the server that folder must exist on the server. That folder exists on the server?

  • 2

    the folder does not exist on the server! so the error, I will make the creation

1 answer

0

There are two factors that can generate this error.

  1. The briefcase Backup_test, does not exist in the same server location where the query is being executed.
  2. The user running the query is not allowed to (change/create) the folder Backup_test.

Solution; check if the folder exists and if it exists check if the sql user is allowed to change it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.