I have a user that is used by a program called TicketMonitor, which is supposed to use an user-defined CLR aggregate function in a SELECT, however, it appears to not have the permissions to do so.
pyodbc.ProgrammingError: ('42000', "[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Die dbo-Spalte oder die benutzerdefinierte Funktion bzw. das benutzerdefinierte Aggregat 'dbo.STR_AGG' wurde nicht gefunden, oder der Name ist mehrdeutig. (4121) (SQLExecDirectW); [42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Anweisung(en) konnte(n) nicht vorbereitet werden. (8180)")
Which roughly translates to command not found. However when I take the exact same statement and put it into the Management Studio application and run it as Admin, it does work, so that leads me to user rights.
When I tried granting execute permission to TicketMonitor, it could not find the user, maybe because it is a Database user and the function is global?
dbo.STR_AGGstrongly implies your function is in a database, on thedboschema. Is the function in a different database perhaps? If so, the login that the user is linked to will need a user created in the other database and given permission to use the function.masterhere). Should the function be inmasterthough?