Program to insert a single quote in the varchar text in SQL Server using Concat Function

Rajnilari2015
Posted by Rajnilari2015 under Sql Server category on | Points: 40 | Views : 876
The below program will do so

declare @tbl table(SomeField varchar(50))
insert into @tbl(SomeField) values(concat('He is one of the leader','''s',' of this world'))
select * from @tbl


Result
--------
/*

SomeField
------------
He is one of the leader's of this world


*/

By using the concat function , we are concateting the string literals.

Comments or Responses

Login to post response