
Using REPLICATE for SQL Strings
The following example replicates a # character five times in front of a Student Number in the Students table: SELECT [Student Name], REPLICATE(‘#’, 5) + [Student Number] AS ‘Student Number’FROM [Students]GOHere is an example result set.Student Name Student NumberTest Name 1 – #####STU1Test Name 2 – #####STU2Test Name 3 –