title: SQL Server Convert Timestamp DataType to Decimal
body: <p>Been Trying to figure this out and according to Cast and Convert Documentation on MSDN, this should be possible (
  <a href="http://msdn.microsoft.com/en-us/library/ms187928.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms187928.aspx</a> )</p>
  
  <p>Have a look at the Conversion table.</p>
  
  <p><img src="https://i.stack.imgur.com/KKs8Y.gif" alt="enter image description here"></p>
  
  <p>I am running the following Code:</p>
  
  <pre><code>CREATE TABLE TableName (
      ID bigint Identity(1,1),
      SomeValue nvarchar(20) not null,
      TimestampColumn timestamp not null)
  
  Insert Into TableName (SomeValue)
  values ('testing')
  
  SELECT Convert(decimal, TimeStampColumn) from TableName
  </code></pre>
  
  <p>However I simply get the following error:</p>
  
  <blockquote>
    <p>Error converting data type timestamp to numeric.</p>
  </blockquote>
  
  <p>This should be possible according to the documentation or am I missing something?
  Note I will also need to convert back to the same timestamp value.</p>
  
  <pre><code>SELECT TimeStampColumn, Convert(timestamp, Convert(decimal, TimeStampColumn)) 
  FROM TableName
  </code></pre>
  
  <p>In the end the above query should render the same value.</p>