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 of the specified number of space characters.

SPACE(number)

Parameter Values

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

Technical Details

Works in: SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse

❮ SQL Server Functions