July 15, 2016 at 11:00 am
I have an AD account that can see a particular scalar function, but cannot execute it properly. It is supposed to return Current_User. The AD account can run the contents, but when encapsulated within the function returns no errors, but no information.
Yet, When I grant the account sysadmin, the function works properly. To be sure I granted the account dbownership to all databases, local Administrators rights; everything execept server roles and it will not run properly.
any ideas?;-)
July 15, 2016 at 12:38 pm
Firemander (7/15/2016)
I have an AD account that can see a particular scalar function, but cannot execute it properly. It is supposed to return Current_User. The AD account can run the contents, but when encapsulated within the function returns no errors, but no information.Yet, When I grant the account sysadmin, the function works properly. To be sure I granted the account dbownership to all databases, local Administrators rights; everything execept server roles and it will not run properly.
any ideas?;-)
My question is why do you want a scalar function to get the current user? Why not just use ORIGINAL_LOGIN() and forget about the scalar function?
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
July 15, 2016 at 12:41 pm
Agree; but can't change it. vendor code.
July 15, 2016 at 12:46 pm
Firemander (7/15/2016)
Agree; but can't change it. vendor code.
Ahh. Did you grant EXECUTE on the scalar function to the user, or better yet the role they belong to? I have seen many people grant SELECT thinking that will work but for scalars it is execute.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply