Playback starts YouTube’s embedded player (privacy-enhanced mode).
How to Concatenate String Values with Integer values in SQL Server - TSQL Tutorial
ChannelTechBrothersITDescription from the creator
How to Concatenate String and Integer Values in SQL Server ( + Sign vs CONCAT ) - TSQL Tutorial
Working with Databases is fun. On daily basis we save data into tables in different columns and often we need to write queries which involve concatenation of multiple columns of different datatypes to produce our final output. In below example we have saved some data into #Customer Table which has Street Address column as string and zip as INT. we want to produce Full Address by concatenating these columns. To concatenate we can use + sign but this works only with String values. So if we have any Integer value/s we have to convert them to String first. We can use Cast or Convert function to convert Integer value to string. Also if there is any Null value among which values we are concatenating , our output will be Null by using + sign. To take care of that part we can use either ISNULL() or Coalesce Function to replace NULL with blank value in SQL Server.
In SQL Server 2012 and Later versions, CONCAT function was introduced. You can concatenate multiple values by using this function. Fun part of this function is you don't have to worry about Null outcome as it will Ignore Null values and also you don't have to worry about converting INT into strings, It will take care of that automatically. So if you are using new versions such as 2012 or later, start taking advantage of this function.
Blog post link for the video with script
sqlage.blogspot.com/2015/03/how-to-concatenate-…
Working with Databases is fun. On daily basis we save data into tables in different columns and often we need to write queries which involve concatenation of multiple columns of different datatypes to produce our final output. In below example we have saved some data into #Customer Table which has Street Address column as string and zip as INT. we want to produce Full Address by concatenating these columns. To concatenate we can use + sign but this works only with String values. So if we have any Integer value/s we have to convert them to String first. We can use Cast or Convert function to convert Integer value to string. Also if there is any Null value among which values we are concatenating , our output will be Null by using + sign. To take care of that part we can use either ISNULL() or Coalesce Function to replace NULL with blank value in SQL Server.
In SQL Server 2012 and Later versions, CONCAT function was introduced. You can concatenate multiple values by using this function. Fun part of this function is you don't have to worry about Null outcome as it will Ignore Null values and also you don't have to worry about converting INT into strings, It will take care of that automatically. So if you are using new versions such as 2012 or later, start taking advantage of this function.
Blog post link for the video with script
sqlage.blogspot.com/2015/03/how-to-concatenate-…
About this tutorial
TechBrothersIT published this 10:23 video tutorial on November 8, 2015. It has been watched 21,054 times on YouTube.
- Channel
- TechBrothersIT
- Category
- Science & Technology
- Duration
- 10:23
- Published
- November 8, 2015
- Views
- 21,054
- Likes
- 49
Tags
Share
This tutorial in other languages
- FRComment les valeurs Concatenate chaîne avec des valeurs entières dans SQL Server - TSQL Tutorial
- ESCómo Valores Concatenar cadena con valores enteros en SQL Server - TSQL Tutorial
- PTComo Valores Concatenate corda com valores inteiros no SQL Server - TSQL Tutorial
- ITCome valori Concatenate stringa con valori interi in SQL Server - TSQL Tutorial
- DEWie verketten String Werte mit Integer-Werte in SQL Server - TSQL Tutorial
- NLHoe te Concatenate String Waarden met Integer waarden in SQL Server - TSQL Tutorial
- RUКак Объединить строковых значений со значениями Integer в SQL Server - TSQL Учебное пособие
- PLJak wartości Łączy napis z wartościami całkowitą w SQL Server - TSQL Tutorial
- JAどのようにSQL Serverの整数値で連結した文字列の値に - TSQLチュートリアル
- ARكيفية القيم سلسل سلسلة مع القيم عدد صحيح في SQL Server - TSQL دروس
- HIकैसे एसक्यूएल सर्वर में पूर्णांक मान के साथ जुटना स्ट्रिंग मान के लिए - TSQL ट्यूटोरियल
- IDCara Nilai Concatenate String dengan nilai-nilai Integer di SQL Server - TSQL Tutorial