Binary_To_Base64
Converts Binary data to Base64 string
- Free Function
- SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017
SELECT SQLHTTP.net.Binary_To_Base64 ( @Binary )
Name | Type | Description |
---|---|---|
@Binary | varbinary(MAX) | Binary data |
varchar(MAX)
1 2 3 4 5 6 7 8 9 10 11 12 |
DECLARE @Bin varbinary(MAX) DECLARE @Base64 nvarchar(MAX) DECLARE @Text nvarchar(MAX) SET @Bin = 0x540068006500200071007500690063006B002000620072006F0077006E00200066006F00780020006A0075006D007000730020006F00760065007200200074006800650020006C0061007A007900200064006F006700 SET @Base64 = SQLHTTP.net.Binary_To_Base64(@Bin) SET @Text = SQLHTTP.net.Base64_To_Unicode(@Base64) SELECT @Text |
1 2 3 4 |
----------------------------------------------- The quick brown fox jumps over the lazy dog |