How can I remove leading and trailing quotes in SQL Server?

前端 未结 14 1413
青春惊慌失措
青春惊慌失措 2020-12-15 03:28

I have a table in a SQL Server database with an NTEXT column. This column may contain data that is enclosed with double quotes. When I query for this column, I want to remo

14条回答
  •  萌比男神i
    2020-12-15 04:18

    You can simply use the "Replace" function in SQL Server.

    like this ::

    select REPLACE('this is a test message','"','')
    

    note: second parameter here is "double quotes" inside two single quotes and third parameter is simply a combination of two single quotes. The idea here is to replace the double quotes with a blank.

    Very simple and easy to execute !

提交回复
热议问题