SQL Server SPACE() Function
THE WORLD'S LARGEST WEB DEVELOPER SITE

SQL Server SPACE() Function

❮ SQL Server Functions

Example

Return a string with 10 spaces:

SELECT SPACE(10);
Try it Yourself »

Definition and Usage

The SPACE() function returns a string with a specified number of spaces.

Syntax

SPACE(number)

Parameter Values

Parameter Description
number Required. The number of spaces to be returned

Technical Details

Works in: SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, SQL Server 2005

❮ SQL Server Functions