SPACE() function of SQL Server
Posted by Viral Sarvaiya on February 16, 2012
Usually when we concatenate two fields like firstname and lastname we use ‘ ‘ between them like below
select firstname + ' ' + lastname from tblEmployee
And if we want more space then we use long space between them, but sql server provide function for print space between query.
select firstname + SPACE(2) + lastname from tblEmployee
It will return like below.