Doubt with Script to Generate Database Backup Sql Server 2014 [duplicate]

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.
    
asked by anonymous 28.09.2016 / 17:59

1 answer

0

There are two factors that can cause this error.

  • The Backup_test folder does not exist in the same location as the server where the query is running.
  • The user who is running the query does not have permission to change the Backup_test folder.
  • Solution; verify that the folder exists and if it exists check that the sql user has permission to change it.

        
    30.09.2016 / 22:39