SQL Server SPACE() Function

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

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.