Replicate() function is one of special function in SQL Server.
When you insert maximum number of characters to name per one column is very difficult.
By using replicate() function is very easy to insert more characters or string to the particular column.
How many time character/string is repeated, based on the integer value.
REPLICATE(‘ABC’,30) // ABC string is repeated 30 number of times.
create database db1
create table emp(eno int,ename varchar(900),sal int)
insert into emp values(1,REPLICATE(‘A’,890),15000) // A ->is repeated 890 times.
insert into emp values(2,REPLICATE(‘bujji’,40),20000) // bujji ->is repeated 40 times
Note: The ename should not cross the 900 bytes, because max size was mentioned ename(900) in a table.
select * from emp