title: How to Encrypt Column Data in SQL?
body: <p>I tried convert column data to  new encrpted data.I get this error </p>
  
  <pre><code>  Argument data type int is invalid for argument 1 of DecryptByKey function.
  </code></pre>
  
  <p>Query :</p>
  
  <pre><code>SELECT ID,FirmName,newDeviceID=CONVERT(VARCHAR(MAX),DecryptByKey(DeviceID))
  
  FROM Table1
  </code></pre>
  
  <p>DeviceID is int.</p>