SQL Server: How do you remove punctuation from a field?

前端 未结 8 1265
甜味超标
甜味超标 2021-02-05 20:50

Any one know a good way to remove punctuation from a field in SQL Server?

I\'m thinking

UPDATE tblMyTable SET FieldName = REPLACE(REPLACE(REPLACE(FieldNa         


        
8条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-05 21:30

    If it's a one-off thing, I would use a C# + LINQ snippet in LINQPad to do the job with regular expressions.

    It is quick and easy and you don't have to go through the process of setting up a CLR stored procedure and then cleaning up after yourself.

提交回复
热议问题