title: BACKUP DATABASE is terminating abnormally
body: <p>I have a stored procedure, which performs a database backup for a specific database like this :   </p>
  
  <pre><code> ALTER PROC [dbo].[SP_Backup]
      @DataBaseName NVARCHAR(500) = NULL 
      @fullPath NVARCHAR(500) OUTPUT
  AS 
      BEGIN
          DECLARE @dbpath NVARCHAR(500);
              SELECT  @DataBaseName = DB_NAME()
              SELECT  @dbpath = physical_name
              FROM    sys.database_files
              WHERE   ( name = N'myDb' );
              SELECT  @fullPath = SUBSTRING(@dbpath, 0,
                                  LEN(@dbpath) - CHARINDEX('\',
                                  REVERSE(@dbpath)
                                  + '\') + 1);
              SELECT  @fullPath = @fullPath + N'\Backups\' + @DataBaseName + N'.bak'
              BACKUP DATABASE @DataBaseName
          TO DISK = @fullPath;
      END;
  </code></pre>
  
  <p>The problem is, it does work on one server and does not work on another server (the servers are on same machines.-- sql 2008 r2). and i get the exception "BACKUP DATABASE is terminating abnormally."</p>
  
  <p>backup folders have same permission settings and are like this:</p>
  
  <pre><code>C:\Program Files\Microsoft SQL Server\MSSQL10_50.Server1\MSSQL\DATA\Backup
  C:\Program Files\Microsoft SQL Server\MSSQL10_50.Server2\MSSQL\DATA\Backup
  </code></pre>
  
  <p>and sql users are same too;</p>
  
  <p>In the log file there are the following informations:</p>
  
  <pre><code>Error: 18204, Severity: 16, State: 1.
  BackupDiskFile::CreateMedia: Backup device 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.Server2\MSSQL\DATA\Backups\myDb.bak' failed to create. Operating system error 3(failed to retrieve text for this error. Reason: 1815).
  Error: 3041, Severity: 16, State: 1.
  BACKUP failed to complete the command BACKUP DATABASE myDb. Check the backup application log for detailed messages.
  </code></pre>
  
  <p>What could be the reason for that ?</p>