The Meaning of Stored Procedures. Part 8 — The case of “sp_” prefix and a geek riddle

Let me start the last part of the series with a simple question — What does the “sp_” prefix stand for? If your immediate answer is “system stored procedures, of course” you are only partially right. The better answer would be “sp stands for special prefix”. It might sound funny, but they are good reasons [...]

The Meaning of Stored Procedures Part 7 — No direct owners, name resolutions and the difference between EXECUTE AS SELF and EXECUTE AS OWNER

There is surprisingly much misunderstanding about schema-user separation, and about how name resolution as well as impersonation work in SQL Server. The ability to impersonate users by code modules was added in SQL Server 2005, along with database schemas (SQL Server 2000 only allowed context switching by executing SETUSER statement), but those features are still [...]

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 — [...]