SQL Server

SET STATISTICS PROFILE

SQL Server provides various tools and commands to help database administrators and developers analyze and optimize query performance. One of these commands is SET STATISTICS PROFILE. This command is particularly useful for obtaining a detailed execution plan along with the runtime statistics of a query, which can be invaluable for…

Read more
SQL Server

Temporary Stored Procedures

Few people know that it is possible to create temporary stored procedures in SQL Server. I often ask about this when recruiting new candidates, and 9 out of 10 ask if I meant temporary tables, or if they start talking about them right away. So yes, we can indeed create…
SQL Server

Maximum Number of Columns in SELECT Statements

SQL Server, like many relational database management systems, has specific limitations that developers need to be aware of when designing and implementing database solutions. One such limitation is the maximum number of expressions that can be specified in the SELECT list of a query. This limit is set at 4096…
SQL Server

Understanding Sparse Columns

Sparse columns in SQL Server are an intriguing feature designed to optimize storage for columns that contain a significant amount of NULL values. Introduced in SQL Server 2008, sparse columns offer a way to store nulls efficiently, consuming no storage space for NULL values in a column. This feature can…

Read more
SQL Server

Scalar Functions and Parallel Execution Plans

This article is just a simple demonstration of improvements in scalar functions handling implemented in SQL Server 2019. Prior to this version when the scalar function was used in a query, it was blocking parallel plan generation. You can read more on this topic in this article. One of the…
SQL Server

IDENTITY_CACHE and gaps in identity values chain

SQL Server 2016 brings a lot of new configuration options at the database level (DATABASE SCOPED CONFIGURATION) instead of at the instance level only. SQL Server 2017 adds to this list another new option. It’s called IDENTITY_CACHE and allows us to adjust if the IDENTITY values generator will use cache…

Read more