title: using cast or convert function in stored procedure
body: <p>why we have to use cast or cnvert function in 2nd and 3rd selecct statement, and what we achieve by casting or converting it to varchar, what varchar data type do in it exactly?   </p>
  
  <pre><code>DECLARE @mybin1 binary(5), @mybin2 binary(5)
  SET @mybin1 = 0xFF
  SET @mybin2 = 0xA5
  -- No CONVERT or CAST function is necessary because this example 
  -- concatenates two binary strings.
  SELECT @mybin1 + @mybin2
  -- A CONVERT or CAST function is necessary because this example
  -- concatenates two binary strings plus a space.
  SELECT CONVERT(varchar(5), @mybin1) + ' ' 
      + CONVERT(varchar(5), @mybin2)
  -- Here is the same conversion using CAST
  SELECT CAST(@mybin1 AS varchar(5)) + ' ' 
      + CAST(@mybin2 AS varchar(5))
  </code></pre>