title: How to declare VARCHAR variables in MSSQL
body: <p>I want to declare a <code>VARCHAR</code> variable in MSSQL that can hold this</p>
  
  <pre><code>set @RaiseErrorMessage = 
                ('ErrorNumber='+(cast((select ERROR_NUMBER()) as varchar(100)))+
                ,ErrorSeverity='+ (cast((select ERROR_SEVERITY()) as varchar(100)))+
               ',ErrorState='+(cast((select ERROR_STATE()) as varchar(100)))+                                                             
                  ',ErrorLine='+(cast((select ERROR_LINE()) as varchar(100)))+
                  ,ErrorMessage='+(cast((select ERROR_MESSAGE()) as varchar(100))))
  </code></pre>
  
  <p>How should the declaration look for an variable like this?
  I tried </p>
  
  <pre><code> declare @RaiseErrorMessage  varchar
  </code></pre>
  
  <p>but it didn't help.</p>