This New function in SQl Server 2012  (Replicate)

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

 

Example :

DECLARE @FirstString nVARCHAR(MAX)
SET @FirstString = REPLICATE(‘A’,12000)
Select @FirstString
SELECT LEN(@FirstString) LenFirstString;

Replicate Function

 

Now we see the Result of character”A” it’s repeated but the Question

Why when i Select the Len the result is 8000 not 12000 ?

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.