title: How do I determine if a database role exists in SQL Server?
body: <p>I'm trying to figure out how I can check if a database role exists in SQL Server.  I want to do something like this:</p>
  
  <pre><code>if not exists (select 1 from sometable where rolename='role')
  begin
  CREATE ROLE role
      AUTHORIZATION MyUser;
  end
  </code></pre>
  
  <p>What table/proc should I use here?</p>