BIT_COUNT in SQL Server
Learn how the BIT_COUNT() function works and how it enabled operations where data is stored in bits.
2026-08-07
3,534 reads
Learn how the BIT_COUNT() function works and how it enabled operations where data is stored in bits.
2026-08-07
3,534 reads
Learn the basics of the CROSS APPLY operator with a few examples in this short piece.
2026-07-27
4,142 reads
This article shows how the TRY_PARSE() and TRY_CONVERT() functions can be used to handle data quality issues and ensure that your software continues to function without throwing errors.
2026-07-13
3,540 reads
Learn about an alternative strategy for avoiding hardcoded literal values in SQL Server queries by using single-row views designed to mimic enum behavior.
2026-06-26
3,012 reads
Introduction When developers first learn SQL aggregation, they usually start with the GROUP BY clause. It works well for summary reports because it combines multiple rows into a single result for each group. For example, you can calculate total sales per region or average salary per department. The limitation of GROUP BY appears when you […]
2026-06-05
4,126 reads
SQL Server 2022 brought powerful new T-SQL functions that eliminate long-standing workarounds. This article walks through five of the most impactful additions — GENERATE_SERIES, GREATEST/LEAST, DATE_BUCKET, the WINDOW clause, and IS NOT DISTINCT FROM — with practical code examples you can use immediately.
2026-05-29
6,754 reads
A short introduction to how deadlocks work and how you can affect their behavior inside your system.
2026-07-13 (first published: 2026-05-01)
2,935 reads
Introduction SQL Server includes several built-in mathematical functions that allow developers to perform complex calculations directly within queries. Among these are trigonometric functions such as SIN(), COS(), and TAN(), which are useful in scenarios involving engineering calculations, geographic data processing, simulations, and analytics. Although these functions are straightforward to use, developers occasionally encounter unexpected results […]
2026-04-29
2,402 reads
Generating temporary passwords is a common requirement in many applications. Users may need to reset a forgotten password, new accounts may require an initial password, or developers may generate test credentials. While password generation is often implemented in application code, doing it directly in SQL Server provides clear advantages. It centralizes the logic, ensures consistency […]
2026-04-10
2,126 reads
Answering a couple of questions from the previous posts about dropping columns.
2026-03-18
2,078 reads
By Brian Kelley
I developed these rules a while back, before COVID. I had a period of...
By Steve Jones
Someone asked why I would use TRY_PARSE after I posted a question at SQL...
My mugI grew up surrounded by coffee farms in Guatemala and somehow spent most...
I have a table that ends in ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]. I'm about to...
Comments posted to this topic are about the item OUTER APPLY Fundamentals: Part 2
Comments posted to this topic are about the item Building Great Software
I have this data in the OrderHeader table in a SQL Server 2025 database (ordered by CustomerID ASC):
orderid orderdate customerid complete 3 2025-05-10 00:00:00.0002 1 21 2024-01-10 00:00:00.0003 1 15 2023-10-28 00:00:00.0004 1 13 2025-03-08 00:00:00.0006 1 11 2024-04-02 00:00:00.0007 1If I run this query, how many rows are returned?
SELECT * from dbo.OrderHeader where customerid between 3 and '6'See possible answers