Replace apostrophe with null in SQLSERVER Query

Method 1:
DECLARE @STRING VARCHAR(100)
SET @STRING = 'APOSTROPHE''S'
SELECT @STRING AS INPUTSTRING,REPLACE(@STRING,CHAR(39),'') AS OUTPUTSTRING

OUTPUT

Method 2:
DECLARE @STRING VARCHAR(100)
SET @STRING = 'APOSTROPHE''S'
SELECT @STRING AS INPUTSTRING,REPLACE(@STRING,'''','') AS OUTPUTSTRING
 


OUTPUT

No comments:

Post a Comment