Lost and found — calling a system function on per row basis

Those of you who have tried using user-define scalar functions probably found out that they are painfully slow. On the other hand, system scalar functions are freakishly fast. Have you ever wondered why? The very reason is because system functions are called once per query, not per row — yes, this is a huge oversimplification, [...]

The Meaning of Stored Procedures Part 6 — NOCOUNT, ROWCOUNT and @@ROWCOUNT

If you remember, in the second part of this series (“Avoiding recompilations due to plan stability-related reasons”) I was talking about a drawback of setting plan reuse affecting SET option inside stored procedures. Nevertheless, this time I will show you two SET options that really should be set to on. We will start easily — [...]