SQL Flow Field Guide

REPLICATE

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

string transform

What changes

Input
string arguments
Output or change
string or integer
Return type
Returns the same type as string_expression.

Syntax at a glance

REPLICATE ( string_expression , integer_expression )

Work example

Repeat a string or binary expression a requested number of times.

Test Unicode, trailing spaces, collation, empty input, and maximum output length.

Check your work Bound the count and use a max type when output can exceed ordinary length.

Open Microsoft Learn for full syntax, permissions, and details for your version.