title: SQL SUBSTRING vs RIGHT - Best Practice
body: <p>I'm trying to find out the best practice when removing characters from the start of a string.</p>
  
  <p>In some languages, you can use MID without a length parameter however, in TSQL the length is required.</p>
  
  <p>Considering the following code, what is the best practise? (The hex string is variable length)</p>
  
  <pre><code>DECLARE @sHex VARCHAR(66)
  SET @sHex = '0x7E260F3DA734AD4BD816B88F485CE501D843DF067C8EDCB8AC7DAD331852E04D'
  
  PRINT RIGHT(@sHex,LEN(@sHex) -2)
  PRINT SUBSTRING(@sHex,3,LEN(@sHex) -2)
  PRINT SUBSTRING(@sHex,3,65535)
  </code></pre>