title: How do you delete system messages from sys.messages in SQL Server
body: <p>I'm working on DB Migration project where I have to migrate databases from SQL Server 2008 to SQL Server 2016.</p>
  <p>In SQL Server 2008 my team has used to throw custom exceptions using <code>RAISERROR</code> with <code>message_id</code> less than 50000. They have deleted system message id with 35100 from <code>sys.messages</code> which usually throws:</p>
  <blockquote>
  <p>Error number %d in the THROW statement is outside the valid range. Specify an error number in the valid range of 50000 to 2147483647.</p>
  </blockquote>
  <p>Now I would like to delete same message id (<code>35100</code>) from <code>sys.messages</code> table, I cannot use custom messages because I have to do lot of changes in application.</p>
  <p>I want to throw this custom exception using throw when I pass below parameters</p>
  <pre><code>Throw 19175,'19175|WARNING - Confirm Update  ; Error = 19175',1
  </code></pre>
  <blockquote>
  <p>Msg 19175, Level 16, State 1, Line 21<br />
  19175|WARNING - Confirm Update  ; Error = 19175</p>
  </blockquote>
  <p>I tried below approaches but failed</p>
  <ul>
  <li><p>Tried to login with admin account (Admin:Instance)</p>
  </li>
  <li><p>Tried to delete rows in hidden database mssqlsystemresource</p>
  </li>
  <li><p>Tried with <code>SP_Configure 'allow updates'</code></p>
  </li>
  </ul>
  <p>Please explain how I can delete this message id from <code>sys.messages</code> (view), or how I can show the custom exception in SQL Server 2016?</p>