title: sql server - check to see if cast is possible
body: <p>I have the following code to cast nvarchar to integer:</p>
  
  <pre><code>     cast(@value as int)
  </code></pre>
  
  <p>However I have no control of the parameter @value, hence the code might fail. Is there anyway to check if a cast is possible before doing a cast?</p>