title: SQL Server 2008 R2: How to identify and update hexadecimal value
body: <p>I have the following table called as <code>Hexa_Table</code> which consists of only one column namely <code>val</code>. </p>
  
  <p><strong>Table</strong>: <code>Hexa_Table</code></p>
  
  <pre><code>CREATE TABLE Hexa_Table
  (
   val VARCHAR(50)
  );
  </code></pre>
  
  <p><strong>Insertion</strong>:</p>
  
  <pre><code>INSERT INTO Hexa_Table VALUES('123456789101213');
  INSERT INTO Hexa_Table VALUES('414F2D53594F545641');
  INSERT INTO Hexa_Table VALUES('1234F6789A1213G');
  INSERT INTO Hexa_Table VALUES('414F2D363530303035');
  INSERT INTO Hexa_Table VALUES('12345678910');
  </code></pre>
  
  <p><strong>Note</strong>: Now I want to update only those values which are <code>Hexadecimal</code> and want to update it to <code>String</code>, for which I need to identify which are the <code>Hexadecimal</code> values in the table.</p>
  
  <p>For example I have record number 2 that is <code>414F2D53594F545641</code> if you convert it will get <code>AO-SYOTVA</code>. And in 4th record I have <code>414F2D363530303035</code> if you convert it will get <code>AO-650005</code>.</p>
  
  <p>Converted by using : <a href="http://string-functions.com/hex-string.aspx" rel="nofollow">This</a></p>
  
  <p><strong>Questions</strong>:<br>
  1. How to identify hexadecimal values in the table?<br>
  2. How to update hexadecimal values to string?</p>