title: REFERENCES and VIEW DEFINITION permissions to a user on an alias data type
body: <p>I created a new type and a new user:</p>
  
  <pre><code>CREATE TYPE dbo.MY_TYPE FROM varchar (128) NULL
  GO
  CREATE USER MyUser WITHOUT LOGIN;
  GO
  </code></pre>
  
  <p>Then if I don't grant any permissions to that user on my type, then I cannot see definition of that type:</p>
  
  <pre><code>EXECUTE AS USER = 'MyUser';
  GO
  SELECT * FROM sys.types where name = 'MY_TYPE';
  --returns nothing
  REVERT
  GO
  </code></pre>
  
  <p>According to <a href="http://technet.microsoft.com/en-us/library/ms175808(v=sql.105).aspx" rel="nofollow">BOL</a>:</p>
  
  <blockquote>
    <p><em>VIEW DEFINITION granted to individual entities allows the grantee to
    see metadata for the specified entity.</em></p>
  </blockquote>
  
  <p>So if I grant VIEW DEFINITION permission:</p>
  
  <pre><code>GRANT VIEW DEFINITION ON TYPE::dbo.MY_TYPE TO MyUser;
  </code></pre>
  
  <p>and repeat the test, I get the information from sys.types. This is OK.</p>
  
  <p>The questions is why I can solve that issue by granting REFERENCES permission?</p>
  
  <pre><code>REVOKE VIEW DEFINITION ON TYPE::dbo.MY_TYPE FROM MyUser;
  GRANT REFERENCES ON TYPE::dbo.MY_TYPE TO MyUser;
  GO
  
  EXECUTE AS USER = 'MyUser';
  GO
  SELECT * FROM sys.types where name = 'MY_TYPE';
  --see the result here!!!
  REVERT
  GO
  </code></pre>