Expand Minimize
3 out of 5 rated this helpful - Rate this topic

REPLICATE (SQL Server Compact)

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 nvarcharorntext.

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 ([Last Name], 2) AS [Last name twice]
FROM Employees

This is the result set:

Last name twice
--------------------
DavolioDavolio
FullerFuller
LeverlingLeverling
PeacockPeacock
BuchananBuchanan
SuyamaSuyama
KingKing
CallahanCallahan
DodsworthDodsworth
HellsternHellstern
SmithSmith
PattersonPatterson
BridBrid
MartinMartin
PereiraPereira

(15 rows affected)
Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.