SQL SPACE is a string function that replicates the number blanks that you want add to the given string.
SYNTAX
SPACE(number)
number is an integer value.
Lets look at an example of SQL SPACE Function.
The following example concatenates, two string ‘Micorsoft Sql server’ , 15 spaces and ‘2017’
SELECT 'Microsoft SQL SERVER'+ SPACE(15)+'2017' as Output
Lets try to achieve same output without using SPACE function.
Without using space function, we need to add blank manually. To add blank we press enter key 15 times in a sequence.
SELECT 'Microsoft SQL SERVER'+ ' ' +'2017' as Output
Also Read..