From aa8de0645386f0063107ad5494a29111a38e565b Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Fri, 19 Jun 2026 11:55:50 -0600 Subject: [PATCH 1/2] Add note about NULL handling in BIT_COUNT function Clarified behavior of BIT_COUNT with NULL values. --- docs/t-sql/functions/bit-count-transact-sql.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/t-sql/functions/bit-count-transact-sql.md b/docs/t-sql/functions/bit-count-transact-sql.md index 3c5e2ff3695..79b9552e115 100644 --- a/docs/t-sql/functions/bit-count-transact-sql.md +++ b/docs/t-sql/functions/bit-count-transact-sql.md @@ -49,6 +49,8 @@ Any integer or binary expression that isn't a large object ([LOB](#remarks)). For example, `SELECT BIT_COUNT (CAST (-1 AS SMALLINT))` and `SELECT BIT_COUNT (CAST (-1 AS INT))` return `16` and `32` respectively. This is intended, as the binary representation of `-1` can have a different number of bits set to `1` depending on the data type. +If a NULL value is passed into `BIT_COUNT` as the expression value, then a NULL is returned + ## Remarks Distributed Query functionality for the bit manipulation functions within linked server or ad hoc queries (`OPENQUERY`) aren't supported. From 93195ff0919391deda86805bf733352df6e1f912 Mon Sep 17 00:00:00 2001 From: Randolph West MSFT <97149825+rwestMSFT@users.noreply.github.com> Date: Fri, 19 Jun 2026 20:50:55 -0600 Subject: [PATCH 2/2] Apply suggestion from @rwestMSFT --- docs/t-sql/functions/bit-count-transact-sql.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/t-sql/functions/bit-count-transact-sql.md b/docs/t-sql/functions/bit-count-transact-sql.md index 79b9552e115..8c12a6e7635 100644 --- a/docs/t-sql/functions/bit-count-transact-sql.md +++ b/docs/t-sql/functions/bit-count-transact-sql.md @@ -49,7 +49,7 @@ Any integer or binary expression that isn't a large object ([LOB](#remarks)). For example, `SELECT BIT_COUNT (CAST (-1 AS SMALLINT))` and `SELECT BIT_COUNT (CAST (-1 AS INT))` return `16` and `32` respectively. This is intended, as the binary representation of `-1` can have a different number of bits set to `1` depending on the data type. -If a NULL value is passed into `BIT_COUNT` as the expression value, then a NULL is returned +If *expression_value* is `NULL`, `BIT_COUNT` returns `NULL`. ## Remarks