When ever I try to execute the following I get
Msg 195, Level 15, State 10, Line 1
‘dbname’ is not a recognized built-in function name.
USE Personnel
GO
SELECT has_perms_by_name(dbname(), 'OBJECT', 'SELECT') as Have_Select,
* from sys.tables;
GO
I’m not sure if dbname() should be got replaced or if its a syntax error.
You probably want the following which I’ve confirmed works:
And as per a comment it’s not case-sensitive, the problem was the missing underscore.