title: T-SQL is deleting backup file immediately after creating it
body: <p>I created a script in PHP / PDO that executes a line of SQL to make a file backup of various databases. The list of database names and the datestamp with which to select the folder into which to place the file are passed as HTTP REQUEST array elements. The script works, but for some reason SQL Server is deleting the file as soon as the script finishes running. With Explorer open, I can watch the folder and file get created correctly, but the file disappears upon completion. Here's the </p>
  
  <pre><code>$dbh = getPDOConnection();
  $sql = "BACKUP DATABASE :database TO DISK = :path";
  $sth = $dbh-&gt;prepare($sql);
  $dt = $_REQUEST["dtStamp"];
  
  $uncPath = "\\\\[unc server]\\c$\MSSQL\\Backup\\backups_$dt";
  
  if (!file_exists($uncPath)) {
      mkdir($uncPath, null, true);
  }
  $responses = [];
  foreach(explode(",", $_REQUEST["databases"]) AS $d=&gt;$database) {
      $sqlPath = "c:\\MSSQL\\Backup\\backups_$dt\\$database.bak";
  
      $sth-&gt;bindValue(":database", $database);
      $sth-&gt;bindValue(":path", $sqlPath);
      $sth-&gt;execute();
  
      $responses[] = $sth-&gt;fetch(PDO::FETCH_ASSOC);
  }
  </code></pre>
  
  <p>Can anyone point me to what I'm missing? I can't seem to find any documentation from Microsoft that indicates why this behavior would occur.</p>