Skip to main content
edited tags
Link
Paul White
  • 90.3k
  • 30
  • 424
  • 663
Source Link
n8.
  • 222
  • 3
  • 11

Allow public use of functions without giving them database control

I came up with a set of functions that I would like to be accessed from a variety of places. SQL seemed like the best place for this due to accessibility, but I receive this error when trying to use them with a user with only the db_datawriter and db_datareader permissions: "The EXECUTE permission was denied on the object"... etc etc

enter image description here

I want to pass a date and return other dates. Apparently I can't just

SELECT [dbo].[fn_Acct_Day_One] ('1/3/2015')

Any way I can do this without granting db_owner to the user?