bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL Server SPACE() Function

Concept visual

SQL Server SPACE() Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Example

Return a string with 10 spaces:

SELECT SPACE(10);

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

Previous

❮ SQL Server Functions

Next

Previous

SQL Server SOUNDEX() Function

Next

SQL Server STR() Function