CONCAT is one of the new string function which introduced in SQL server 2012.
CONCAT:
CONCAT function takes
‘n’ number of arguments and concatenates them into single string.
Syntax:
CONCAT ( value1, value2………ValueN)
Properties of CONCAT Function:
- It takes minimum two values else it will throws an error
- All Values are implicitly converted to String type
- If all values are NULL then it returns an empty string of Varchar(1)
Example:
SELECT CONCAT ( 'Today Is',07, '/', 10,' Of July' ) AS Result;
And output is:
SELECT CONCAT ( 'Today Is', datepart(dd,getdate()),'/',datepart(mm,getdate()) ) AS Result;
No comments:
Post a Comment