replicate

Description

Returns a string consisting of the specified expression repeated a given number of times.

Syntax

replicate (char_expr | uchar_expr, integer_expr)

Parameters

char_expr

is a character-type column name, variable, or constant expression of char, varchar, nchar or nvarchar type.

uchar_expr

is a character-type column name, variable, or constant expression of unichar or univarchar type.

integer_expr

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

Examples

Example 1

select replicate("abcd", 3)

------------ 
abcdabcdabcd

Usage

Standards

SQL92 – Compliance level: Transact-SQL extension.

Permissions

Any user can execute replicate.

See also

Functions stuff