2
Answers

Replace function

Vamsi k

Vamsi k

6y
821
1

Hi everyone,

I had a doubt in replace function in SQL.
 
In our C# code we are passing 2 values like OCRTYZ-DYZ and D007654 by using concation separting with semicolumn
 OCRTYZ-DYZ;D007654
 
In the Sql script we have written the below replace function to replace the ; to , 

set @val = ''''+replace (@value,';',''',''')+''''

The above all are single quotes. Can anyone please explain what does the above line tells. 
 
 I understood ; is replaced with , but why those single quotes after that , also.
 
Thanks 
Answers (2)