Cannot use the OUTPUT option in DECLARE or CREATE FUNCTION statement
So this may or may not trip you up. If you are like me, you want thing to run fast. One of those ways is to pass a reference to a variable as opposed to passing a copy of the value to the function. In .Net this works well, however SQL Server translates the byref to it’s equivalent which is OUTPUT option. Simply bite the bullet and change the function to have all of your parameters to byval and you are good to go.
Hopefully I saved you some time and agrivation.
I got this web page from my friend who told me on the topic of this
web page and at the moment this time I am visiting
this web site and reading very informative posts at this place.