title: How to check if user has permissions to see View definitions on SQL Server?
body: <p>How to find if the logged in User has permissions to see "view" definitions on SQL Server?  I need to find out what tables/columns a view is made from, </p>
  
  <p>I used this SQL for the same; for view definition, we used this query: </p>
  
  <p>Query: </p>
  
  <pre><code>select * 
  from sys.objects 
  where name like '%SECTION_MASTER_V%' 
  </code></pre>
  
  <p>Result:  579337674</p>
  
  <p>Query: </p>
  
  <pre><code>SELECT definition
  FROM sys.objects o
  JOIN sys.sql_modules m ON m.object_id = o.object_id
  WHERE o.object_id = 579337674
    AND o.type = 'V'   
  </code></pre>
  
  <p>Result: <strong>null</strong></p>
  
  <p>I get null as a result. Does anyone knows what may be wrong here?</p>