Examples of REPLICATE Function :
Example 1 : Use of REPLICATE function in select clause
SELECT REPLICATE('Syntax-Example', 3)
Output
Syntax-ExampleSyntax-ExampleSyntax-Example
Above example returns repeated string 3 times by specified string.
Example 2 : Use of REPLICATE function to display field value of table in a select clause
SELECT ContactName, REPLICATE(ContactName,2) 'Repeated Name'
FROM Customers
Output
ContactName Repeated Name
Maria Anders Maria AndersMaria Anders
Ana Trujillo Ana TrujilloAna Trujillo
Antonio Moreno Antonio MorenoAntonio Moreno
Thomas Hardy Thomas HardyThomas Hardy
Christina Berglund Christina BerglundChristina Berglund
Hanna Moos Hanna MoosHanna Moos
Above example repeats customers name 2 times from customers table.