Escape double quotes in SQL 2005/2008

后端 未结 8 2075
渐次进展
渐次进展 2020-12-21 00:41

I have an international company that has recently been added, which is named \"BLA \"BLAHBLAH\" Ltd. (The double quotes are part of the name. )

Whenever a user tries

8条回答
  •  太阳男子
    2020-12-21 00:52

    You will finally have to extract data from your database and have it displayed on screen or printed on reports. Manipulating double quotes or any extra character can then become very confusing.

    By converting your strings to HTML before INSERTS or UPDATES, you are avoiding all the confusion linked to quotes management. At SELECT time, it will be easy to convert back from HTML. At reporting time (as reporting tools (such as Crystal Reports) propose an HTML formatting option), you will not even have to do anything to display data in a correct way.

    By the way, do not forget to hang the guy that invented this company name.

提交回复
热议问题