Collections:
Concatenating Two Binary Strings in SQL Server
How To Concatenate Two Binary Strings Together in SQL Server Transact-SQL?
✍: FYIcenter.com
SQL Server 2005 allows to concatenate two binary strings into a single string with the (+) operator. The following tutorial exercise shows you some binary string concatenation examples:
-- Concatenating two binary string literals SELECT 0x57656C636F6D6520746F20 + 0x46594963656E7465722E636F6D; GO 0x57656C636F6D6520746F2046594963656E7465722E636F6D -- Watch out: This is not a binary string concatenation SELECT '0x57656C636F6D6520746F20' + '0x46594963656E7465722E636F6D'; GO 0x57656C636F6D6520746F200x46594963656E7465722E636F6D -- Concatenating two binary strings SELECT CONVERT(VARBINARY(40),'Welcome to ') + CONVERT(VARBINARY(40),'FYIcenter.com'); GO 0x57656C636F6D6520746F2046594963656E7465722E636F6D -- Binary strings can not be concatenated with character strings SELECT 'Welcome to ' + 0x46594963656E7465722E636F6D; GO Msg 402, Level 16, State 1, Line 1 The data types varchar and varbinary are incompatible in the add operator.
⇒ Using Binary Strings in Arithmetical Operations in SQL Server
⇐ CHARINDEX() and SUBSTRING() - Locating and Taking Substrings in SQL Server
⇑ Character Strings and Binary Strings in SQL Server Transact-SQL
2017-03-07, 1503🔥, 0💬
Popular Posts:
Where to find answers to frequently asked questions on Downloading and Installing SQL Server 2005 Ex...
How To Use SQL*Plus Built-in Timers in Oracle? If you don't have a stopwatch/timer and want to measu...
How To Convert Characters to Numbers in Oracle? You can convert characters to numbers by using the T...
Where to find SQL Server Transact-SQL language references? You can find SQL Server Transact-SQL lang...
What Is the Difference Between GETDATE() and GETUTCDATE() in SQL Server Transact-SQL? The difference...