Search This Blog

Thursday, February 6, 2014

SPACE SQL Server Example

SQL Server > Built-in Functions > SPACE

Returns a string of repeated spaces.

Example:

declare

@str nvarchar(max),
@str1 nvarchar(max)

set @str='SQL'
set @str1='SERVER'

select @str + SPACE(5) + @str1


Result:
SQL     SERVER