Skip to content

Commit e1531d0

Browse files
Merge pull request #36245 from MicrosoftDocs/main
Auto Publish – main to live - 2026-01-14 23:30 UTC
2 parents 001416f + 73749b1 commit e1531d0

4 files changed

Lines changed: 37 additions & 30 deletions

File tree

docs/includes/applies-to-version/_fabric-se-dw.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ ms.date: 12/29/2025
55
ms.service: sql
66
ms.topic: include
77
---
8-
[[!INCLUDE [SQL analytics endpoint](../fabric-se.md)] and [!INCLUDE [fabric-dw](../fabric-dw.md)]](../../sql-server/sql-docs-navigation-guide.md#applies-to)
8+
:::image type="icon" source="../media/yes-icon.svg" border="false"::: [[!INCLUDE [SQL analytics endpoint](../fabric-se.md)] and [!INCLUDE [fabric-dw](../fabric-dw.md)]](../../sql-server/sql-docs-navigation-guide.md#applies-to)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
author: rwestMSFT
3+
ms.author: randolphwest
4+
ms.date: 01/13/2026
5+
ms.service: sql
6+
ms.topic: include
7+
---
8+
9+
[!INCLUDE [Applies to](../../includes/applies-md.md)] [!INCLUDE [SQL Server 2025](_ss2025.md)] [!INCLUDE [Azure SQL Database](../../includes/applies-to-version/_asdb.md)] [!INCLUDE [Azure SQL Managed Instance](_asmi.md)] [!INCLUDE [_fabric-se-dw](_fabric-se-dw.md)] [!INCLUDE [fabric-sqldb](_fabric-sqldb.md)]

docs/t-sql/functions/base64-decode-transact-sql.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
title: "BASE64_DECODE (Transact-SQL)"
3-
description: "BASE64_DECODE converts a base64 encoded varchar into the corresponding varbinary."
3+
description: "BASE64_DECODE converts a Base64 encoded varchar into the corresponding varbinary."
44
author: abledenthusiast
55
ms.author: aaronpitman
66
ms.reviewer: wiassaf, randolphwest
7-
ms.date: 02/28/2025
7+
ms.date: 01/13/2026
88
ms.service: sql
99
ms.subservice: t-sql
1010
ms.topic: reference
@@ -14,19 +14,19 @@ f1_keywords:
1414
- "BASE64_DECODE"
1515
- "BASE64_DECODE_TSQL"
1616
helpviewer_keywords:
17-
- "base64 decode [SQL Server], base64 decode"
17+
- "Base64 decode [SQL Server], Base64 decode"
1818
- "BASE64_DECODE function"
19-
- "base64 decoding [SQL Server]"
19+
- "Base64 decoding [SQL Server]"
2020
dev_langs:
2121
- "TSQL"
2222
monikerRange: "=azuresqldb-current || =fabric || =fabric-sqldb"
2323
---
2424

2525
# BASE64_DECODE (Transact-SQL)
2626

27-
[!INCLUDE [asdb-Fabric-SE-fabricDW-fabricsqldb](../../includes/applies-to-version/asdb-fabricse-fabricdw-fabricsqldb.md)]
27+
[!INCLUDE [sqlserver2025-asdb-asmi-fabricse-fabricdw-fabricsqldb](../../includes/applies-to-version/sqlserver2025-asdb-asmi-fabricse-fabricdw-fabricsqldb.md)]
2828

29-
`BASE64_DECODE` converts a base64-encoded **varchar** expression into the corresponding **varbinary** expression.
29+
`BASE64_DECODE` converts a Base64-encoded **varchar** expression into the corresponding **varbinary** expression.
3030

3131
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: [Transact-SQL syntax conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
3232

@@ -58,15 +58,15 @@ The encoded string's alphabet must be that of [RFC 4648 Table 1](https://datatra
5858
Msg 9803, Level 16, State 20, Line 15, Invalid data for type "Base64Decode"
5959
```
6060

61-
- If the data has valid characters, but incorrectly formatted, the function returns error `Msg 9803, State 21`.
61+
- If the data has valid characters but is incorrectly formatted, the function returns error `Msg 9803, State 21`.
6262

63-
- If the input contains more than two padding characters or padding characters followed by extra valid input the function returns error `Msg 9803, State 23`.
63+
- If the input contains more than two padding characters or padding characters followed by extra valid input, the function returns error `Msg 9803, State 23`.
6464

6565
## Examples
6666

6767
### A. Standard BASE64_DECODE
6868

69-
In the following example, the base64 encoded string is decoded back into varbinary.
69+
In the following example, the Base64 encoded string is decoded back into **varbinary**.
7070

7171
```sql
7272
SELECT BASE64_DECODE('qQ==');
@@ -78,9 +78,9 @@ SELECT BASE64_DECODE('qQ==');
7878
0xA9
7979
```
8080

81-
### B. BASE64_DECODE a standard base64 string
81+
### B. BASE64_DECODE a standard Base64 string
8282

83-
In the following example, the string is base64 decoded. Note the string contains URL-unsafe characters `=` and `/`.
83+
In the following example, the string is Base64 decoded. Note the string contains URL-unsafe characters `=` and `/`.
8484

8585
```sql
8686
SELECT BASE64_DECODE('yv7K/g==');
@@ -92,9 +92,9 @@ SELECT BASE64_DECODE('yv7K/g==');
9292
0xCAFECAFE
9393
```
9494

95-
### C. BASE64_DECODE varchar url_safe base64 string
95+
### C. BASE64_DECODE varchar url_safe Base64 string
9696

97-
In contrast to example B, this example base64 string was encoded using RFC 4648 Table 2 (`url_safe`), but can be decoded the same way as example B.
97+
Unlike example B, this example uses RFC 4648 Table 2 (`url_safe`) to encode the Base64 string. However, you can decode it the same way as example B.
9898

9999
```sql
100100
SELECT BASE64_DECODE('yv7K_g');
@@ -106,9 +106,9 @@ SELECT BASE64_DECODE('yv7K_g');
106106
0xCAFECAFE
107107
```
108108

109-
### D. BASE64_DECODE varchar contains characters not in the base64 alphabet
109+
### D. BASE64_DECODE varchar contains characters not in the Base64 alphabet
110110

111-
This example contains characters that aren't valid base64 characters.
111+
This example contains characters that aren't valid Base64 characters.
112112

113113
```sql
114114
SELECT BASE64_DECODE('qQ!!');
@@ -124,4 +124,3 @@ Invalid data for type "Base64Decode".
124124
## Related content
125125

126126
- [BASE64_ENCODE (Transact-SQL)](base64-encode-transact-sql.md)
127-

docs/t-sql/functions/base64-encode-transact-sql.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
title: "BASE64_ENCODE (Transact-SQL)"
3-
description: "BASE64_ENCODE converts the value of a varbinary into a base64 encoded varchar."
3+
description: "BASE64_ENCODE converts the value of a varbinary into a Base64 encoded varchar."
44
author: abledenthusiast
55
ms.author: aaronpitman
66
ms.reviewer: wiassaf, randolphwest
7-
ms.date: 02/28/2025
7+
ms.date: 01/13/2026
88
ms.service: sql
99
ms.subservice: t-sql
1010
ms.topic: reference
@@ -14,19 +14,19 @@ f1_keywords:
1414
- "BASE64_ENCODE"
1515
- "BASE64_ENCODE_TSQL"
1616
helpviewer_keywords:
17-
- "base64 encode [SQL Server], base64 encode"
17+
- "Base64 encode [SQL Server], Base64 encode"
1818
- "BASE64_ENCODE function"
19-
- "base64 encoding [SQL Server]"
19+
- "Base64 encoding [SQL Server]"
2020
dev_langs:
2121
- "TSQL"
2222
monikerRange: "=azuresqldb-current || =fabric || =fabric-sqldb"
2323
---
2424

2525
# BASE64_ENCODE (Transact-SQL)
2626

27-
[!INCLUDE [asdb-Fabric-SE-fabricDW-fabricsqldb](../../includes/applies-to-version/asdb-fabricse-fabricdw-fabricsqldb.md)]
27+
[!INCLUDE [sqlserver2025-asdb-asmi-fabricse-fabricdw-fabricsqldb](../../includes/applies-to-version/sqlserver2025-asdb-asmi-fabricse-fabricdw-fabricsqldb.md)]
2828

29-
`BASE64_ENCODE` converts the value of a **varbinary** expression into a base64-encoded **varchar** expression.
29+
`BASE64_ENCODE` converts the value of a **varbinary** expression into a Base64-encoded **varchar** expression.
3030

3131
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: [Transact-SQL syntax conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
3232

@@ -55,20 +55,20 @@ Optional integer literal or expression, which specifies whether the output of th
5555

5656
## Remarks
5757

58-
The encoded string alphabet is that of [RFC 4648 Table 1](https://datatracker.ietf.org/doc/html/rfc4648#section-4) and might add padding. The URL-safe output uses the base64url alphabet of [RFC 4648 Table 2](https://datatracker.ietf.org/doc/html/rfc4648#section-5) and doesn't add padding. This function doesn't add any new line characters.
58+
The encoded string uses the alphabet from [RFC 4648 Table 1](https://datatracker.ietf.org/doc/html/rfc4648#section-4) and might include padding. The URL-safe output uses the Base64URL alphabet from [RFC 4648 Table 2](https://datatracker.ietf.org/doc/html/rfc4648#section-5) and doesn't include padding. This function doesn't add any new line characters.
5959

6060
In each case, the database default collation is used. For more information on the supported collations in [!INCLUDE [fabric](../../includes/fabric.md)], see [Tables](/fabric/data-warehouse/tables#collation).
6161

62-
If `url_safe` is true, the base64url string that is generated is incompatible with SQL Server's XML and JSON base64 decoders.
62+
If you set `url_safe` to true, the generated Base64URL string isn't compatible with SQL Server's XML and JSON Base64 decoders.
6363

6464
## Examples
6565

6666
### A. Standard BASE64_ENCODE
6767

68-
The following example returns the base64 encoded value for the `©` symbol.
68+
The following example returns the Base64 encoded value for the `©` symbol.
6969

7070
```sql
71-
SELECT Base64_Encode(0xA9) AS "Encoded © symbol";
71+
SELECT BASE64_ENCODE(0xA9) AS "Encoded © symbol";
7272
```
7373

7474
[!INCLUDE [ssResult_md](../../includes/ssresult-md.md)]
@@ -79,7 +79,7 @@ qQ==
7979

8080
### B. BASE64_ENCODE a string
8181

82-
In the following example, a string is base64 encoded. The string must first be casted to a varbinary.
82+
In the following example, a string is Base64 encoded. You must first cast the string to a **varbinary**.
8383

8484
```sql
8585
SELECT BASE64_ENCODE(CAST ('hello world' AS VARBINARY));
@@ -93,7 +93,7 @@ aGVsbG8gd29ybGQ=
9393

9494
### C. BASE64_ENCODE default vs url_safe
9595

96-
In the following example, the first select doesn't specify `url_safe`; however, the second select does specify `url_safe`.
96+
In the following example, the first `SELECT` statement doesn't specify `url_safe`; however, the second `SELECT` statement does specify `url_safe`.
9797

9898
```sql
9999
SELECT BASE64_ENCODE(0xCAFECAFE);
@@ -120,4 +120,3 @@ yv7K_g
120120
## Related content
121121

122122
- [BASE64_DECODE (Transact-SQL)](base64-decode-transact-sql.md)
123-

0 commit comments

Comments
 (0)