title: SQL Server migration 2008 to 2016 - raiserror syntax error
body: <p>We are going to migrate from SQL Server 2008 to 2016. I am in the process of identifying errors and I get the following error in a trigger:</p>
  
  <blockquote>
    <p>Incorrect syntax near '51001'.</p>
  </blockquote>
  
  <p>I looked through the <code>Raiserror</code> documentation on the Microsoft website and it did not help. The following is the SQL. Any help would be appreciated.</p>
  
  <pre><code>IF (SELECT count(*) FROM dbo.u_sample_concrete ref, deleted
  WHERE  ref.lab_cd =  deleted.lab_id) &gt; 0
  BEGIN
      RAISERROR 51001 ''Trigger td_tblLAB on table dbo.tblLAB:  Primary key values found in table dbo.u_sample_concrete (lab_cd).  Delete restricted; the transaction is being rolled back.''
      ROLLBACK TRANSACTION
      RETURN
  END
  </code></pre>