title: Backup of SQL Server database without timestamps
body: <p>I'm using the following line to backup a Microsoft SQL Server 2008 database:</p>
  
  <pre><code>BACKUP DATABASE @name TO DISK = @fileName WITH COMPRESSION
  </code></pre>
  
  <p>Given that database is not changing, repeated execution of this line yields files that are of the same size, but are massively different inside.</p>
  
  <p>How do I create repeated SQL Server backups of the same unchanged database that would give same byte-accurate files? I guess that simple <code>BACKUP DATABASE</code> invocations add some timestamps or some other meta information in the backup media, is there a way to disable or strip this addition?</p>
  
  <p>Alternatively, if it's not possible, is there a relatively simple way to compare 2 backups and see if they'll restore of the exactly same state of the database?</p>
  
  <p><strong>UPDATE</strong>: My point for backup comparison is that I'm backing up myriads of databases daily, but most databases don't change that often. It's normal for most of them to change several time per year. So, basically, for all other DBMS (MySQL, PostgreSQL, Mongo), I'm using the following algorithm:</p>
  
  <ul>
  <li>Do a new daily backup</li>
  <li>Diff new backup with the most recent of the old backups</li>
  <li>If the database wasn't changed (i.e. backups match), delete the new daily backup I've just created</li>
  </ul>
  
  <p>This algorithm works with all DBMSes we've encountered before, but, alas, it fails because of non-repeatable MSSQL backups.</p>