Expand Minimize
0 out of 1 rated this helpful - Rate this topic

REPLICATE (SQL Server Compact Edition)

SQL Server 2005

Repeats a character expression a specified number of times.


REPLICATE ( character_expression, integer_expression) 
character_expression

An alphanumeric expression of character data, or other data types that are implicitly convertible to nvarchar or ntext.

integer_expression

An expression that can be implicitly converted to int. If integer_expression is negative, a null string is returned.

nvarchar or ntext

The following example replicates twice the last name of each employee in the Employee table.

SELECT REPLICATE (LastName, 2) AS "LastName Twice"
FROM Employees

This is the result set:

LastName Twice
--------------
FunkFunk
PearsonPearson
CalafatoCalafato
DannerDanner
LeeLee
ByhamByham
SuttonSutton
KingKing
DoyleDoyle
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.