Tuesday, November 24, 2015

Replicate Function in SQL Server 2012

This is a New function in SQL Server 2012

It repeats the string/character expression N number of times specified in the function.

Example :

DECLARE @FirstString nVARCHAR(MAX)
SET @FirstString = REPLICATE('A',11)
Select @FirstString
SELECT LEN(@FirstString) LenFirstString;

Result
AAAAAAAAAAA

LenFirstString
11

No comments:

Post a Comment