title: Timestamp Field Incriminating
body: <p>I have a table as such (with a timestamp and a varbinary)</p>
  
  <pre><code>CREATE TABLE [dbo].[CASE]
  (
      [CASE_ID] [int] IDENTITY(1,1) NOT NULL,
      [CASE_TITLE] [varchar](50) NOT NULL,
      [CASE_STATUS] [varchar](50) NOT NULL,
      [MODIFIED_TS] [timestamp] NOT NULL,
      [SYNCED_TS] [varbinary](8) NULL
  )
  </code></pre>
  
  <p>Then I add an item to it, and update it...</p>
  
  <pre><code>UPDATE [CASE] 
  SET CASE_STATUS = 'Something New' 
  WHERE CASE_ID = 1
  </code></pre>
  
  <p>When I do that, then I update the <code>Synced_TS</code> column:</p>
  
  <pre><code>UPDATE [CASE] 
  SET SYNCED_TS = MODIFIED_TS 
  WHERE CASE_ID = 1
  </code></pre>
  
  <p>But then, when I run this....</p>
  
  <pre><code>SELECT 
      *, 
      CAST(CONVERT(BIGINT, MODIFIED_TS) - CONVERT(INT, SYNCED_TS) AS DECIMAL)
  FROM 
      [CASE]
  WHERE 
      CAST(CONVERT(BIGINT, MODIFIED_TS) - CONVERT(INT, SYNCED_TS) AS DECIMAL) &gt; 1
      OR SYNCED_TS IS NULL
  </code></pre>
  
  <p>I have two values that are totally different, for example, A0D, and A0A, its OK they are different, but shouldn't it be A0D, and A0C?</p>
  
  <pre><code>MODIFIED_TS         SYNCED_TS
  ---------------------------------------
  0x0000000000000A0D  0x0000000000000A0A
  </code></pre>
  
  <p>The reason why its an issue, is that I am trying to convert it to an integer to compare it, so I can determine if the record needs to be synced or not.</p>