Okay, so I may have messed up. I was attempting to create a system function that would truncate a datetime field (essentially creating a SQL Server verion of Oracle's TRUNC()).

Everything seemed to go perfectly but, when called as user with minimal privileges, it throws an error saying the permission is denied. When logged in as a sysadmin, it seems to run fine (although the return isn't what I had expected).

Here are the errors I get when trying to perform certain actions:

ACTION : call the function
ERROR : as mentioned above

ACTION : grant permissions
ERROR : Invalid object name 'system_function_schema.fn_trunc'

ACTION : open the function
ERROR : Unable to retrieve text

ACTION : delete the function
ERROR : function does not exist in the function catalog

So you see, I'm stuck. I tried to do all of this via Query Analyzer AND Enterprise Manager while logged in as a sysadmin. Can someone help me out of this mess I've created for myself?

Any help would be greatly appreciated.