ROHIT techVlog
Software guide, IT Technical Knowledge sharing and Technology Discussion Forum.
SQL
Home
SQL Error
SQL Server
T-SQL
Interview Q&A
SSIS
SSRS
Power BI
Pages
SQL Server
SSRS
T SQL
SQL Errors
SQL Tutorial
SQL Tricky Examples
Saturday, August 15, 2020
REPLICATE() Function in SQL Server
SQL Server REPLICATE() function is used to repeat a specified string for a given number of time.
Syntax:
REPLICATE (string, integer)
Example:
1.
Select
replicate
('
A
',5)
Output:
AAAAA
2.
Select
replicate
(('A'+' '),5)
Output:
A A A A A
3.
select
Name,
REPLICATE
('0',3)+ProductLine as Prod_Code from Production.Product
where ProductLine='R'
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment