space

Description

Returns a string consisting of the specified number of single-byte spaces.

Syntax

space(integer_expr)

Parameters

integer_expr

is any integer (tinyint, smallint, or int) column name, variable, or constant expression.

Examples

Example 1

select "aaa", space(4), "bbb"
--- ---- --- 
aaa      bbb

Usage

space, a string function, returns a string with the indicated number of single-byte spaces.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute space.

See also

Documentation Transact-SQL Users Guide

Functions isnull, rtrim