This is probably an impossible question, but sp_lock calls object_name(object_id, dbid)
but where a user is not a member of that database, it throws a string of errors.
Those errors stop client program (a python script) from receiving the output of sp_lock @verbose=1
In what manner could I detect if I were a member of dbname
, without having access to dbname..sysusers
?
If I knew the answer to that, I could make the column with the value object_name(object_id, dbid)
conditional upon access to each database.
I suspect it's not possible but wanted to see if anyone might surprise me.
cheers