Collections:
Concatenating Two Character Strings in SQL Server
How To Concatenate Two Character Strings Together in SQL Server Transact-SQL?
✍: FYIcenter.com
Concatenating two character strings together is most commonly used string operation. SQL Server 2005 allows to concatenate two character strings into a single string with the (+) operator. The following tutorial exercise shows you some string concatenation examples:
DECLARE @site VARCHAR(40); SET @site = 'FYIcenter.com'; SELECT 'Welcome to '+@site; SELECT 'Current date and time is ' +CONVERT(VARCHAR(20), GETDATE()); GO Welcome to FYIcenter.com Current date and time is May 19 2007 5:18PM DECLARE @start INT, @end INT, @total INT; SET @start = 21; SET @end = 30; SET @total = 728; SELECT 'Search result ' + CONVERT(VARCHAR(20),@start) + ' - ' + CONVERT(VARCHAR(20),@end) + ' of ' + CONVERT(VARCHAR(20),@total); GO Search result 21 - 30 of 728
⇒ String Type Conversion During Concatenation in SQL Server
⇐ Character Strings and Binary Strings in SQL Server Transact-SQL
⇑ Character Strings and Binary Strings in SQL Server Transact-SQL
2017-03-11, 4901🔥, 0💬
Popular Posts:
What Is the Difference Between GETDATE() and GETUTCDATE() in SQL Server Transact-SQL? The difference...
What is dba.FYIcenter.com Website about? dba.FYIcenter.com is a Website for DBAs (database administr...
What Are Date and Time Functions in MySQL? MySQL offers a number of functions for date and time valu...
How To Convert Numeric Expression Data Types using the CAST() Function in SQL Server Transact-SQL? I...
What To Do If the StartDB.bat Failed to Start the XE Instance in Oracle? If StartDB.bat failed to st...