How to see the source SELECT statement of views?

  • I don't have permissions to right click\design views or to script the views.  Is there another way to see the source SELECT statement?  I don't see anything under the INFORMATION_SCHEMA.VIEWS.

  • If you don't have permission, you won't have permission period, but the command-line way to get the text is:

    EXEC sys.sp_helptext 'view_name'

     

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

  • Thank you.  I tried out the EXEC statement and received an error.  I'm guessing it's because I don't have adequate permissions, like you said.

  • Likely you don't have permission. The best way is just to ask someone. They might not give you permissions, but I'd hope they would send you the definition.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply