Which tables do I have SELECT permissions on?

Oopps! Upgrade your browser pretty please. Oopps! Upgrade your browser pretty please.

I would like to share a little tip form Books Online, that I found the other day. Sometimes it is needed to find out what my permissions are. A good function to use in that case is HAS_PERMS_BY_NAME. If for example I would like to find out what tables I have SELECT permissions on, I could run the following query:

SELECT HAS_PERMS_BY_NAME (QUOTENAME(SCHEMA_NAME(schema_id)) + ‘.’ + QUOTENAME(name),     ‘OBJECT’, ‘SELECT’) AS have_select, * FROM sys.tables

Read more about HAS_PERMS_BY_NAME at http://msdn.microsoft.com/en-us/library/ms189802.aspx