Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SPACE

SPACE

SQL Server 2000

Returns a string of repeated spaces.

Syntax
SPACE ( integer_expression )
Arguments
integer_expression
Is a positive integer, or an expression that can be implicitly converted to int, that indicates the number of spaces. If integer_expression is negative or greater than 255, a null string is returned.
Return Types

nvarchar

Examples

The following example uses the Employees table in the Northwind database. The example concatenates the last names of the employees, a comma, two spaces and the first names of the employees.

SELECT LastName + ',' + SPACE(2) + FirstName
FROM Employees

Show:
© 2015 Microsoft