Home » SQL SPACE()

SQL SPACE()

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()

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 do same example without using space() function.

SELECT 'Microsoft SQL SERVER'+ '                ' +'2017' as Output

 

 

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.