Example
Repeat a string:
sql
SELECT REPLICATE('SQL Tutorial', 5);
Definition and Usage
The REPLICATE() function repeats a string a specified number of times.
Syntax
text
REPLICATE(string, integer)
Parameter Values
| Parameter | Description |
|---|---|
| string | Required. The string to repeat |
| integer | Required. The number of times to repeat the string |
Technical Details
| Works in: | SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse |
|---|
More Examples
Example
Repeat the text in CustomerName two times:
sql
SELECT REPLICATE(CustomerName, 2)
FROM Customers;