Thursday, January 8, 2015

Use Of REPLICATE() Function In Sql Server..

This Function Repeats a string value a specified number of times. You can use this function In SQL Server 2008 and later versions.

Syntax:
REPLICATE ( string_expression ,integer_expression ) 

string_expression
Is an expression of a character string or binary data type. string_expression can be either character or binary data.
integer_expression
Is an expression of any integer type, including bigint. If integer_expression is negative, NULL is returned.

Excute below select statement and see the output:

SELECT REPLICATE( 'Vimal Kumar Prajapati' , 3 ) As Name




Thanks For Reading This Post!!!

References: Microsoft BOL

No comments:

Post a Comment