What bit for UDFs when using PERMISSIONS()? | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

What bit for UDFs when using PERMISSIONS()?

As far as I can understand from BOL, you need to check the bit that corresponds to SELECT:<br /><br />PERMISSIONS(&lt;udf_objectid&gt<img src=’/community/emoticons/emotion-5.gif’ alt=’;)‘ /> & 0x1<br /><br />However, this is only correct for UDFs that return a table.<br /><br />Also, this bit seems to apply only to dbowners and sysadmins, not to a member of a non-fixed database role that has SELECT permission on the function.<br /><br />If I use 0x20, which corresponds to EXECUTE permission on a procedure, I do get the correct result, but BOL says it only applies to procedures.<br /><br />Any opinions?
<bump>
]]>