AhTu_SQL2k+ - Thursday, March 14, 2019 9:08 PM
I'd already validated that your syntax wasn't the problem. However, with no idea what the function does or the code within, we've got zero chance at helping. Although there are a couple of things to try. Force the object to be recompiled by running sp_recompile on it. Then capture an execution plan when you run it with encryption, and again when you run it without. Look at the differences. It might tell you something. However, without either of those execution plans, we're probably going to be left guessing.
EDIT: Be sure to recompile between executions, so you are starting at a known point each time.
Steve (aka sgmunson) 🙂 🙂 🙂
Rent Servers for Income (picks and shovels strategy)