SET QUOTED IDENTIFIER should be ON when inserting a record

前端 未结 4 1606
一整个雨季
一整个雨季 2020-12-06 12:00

I am stuck in a rather strange problem with SQL Server 2005, which throws

\"SET QUOTED IDENTIFIER should be on when inserting record\"

4条回答
  •  感情败类
    2020-12-06 12:05

    After a long struggle we were able to fix this problem. I just wanted to share the reason.

    Our build team maintains a separate in-house tool to deploy scripts, which internally triggers the SQLCMD (shell) utility to execute T-SQL scripts in a db.

    Here is the culprit: by default, QUOTED_IDENTIFIER is OFF when running in SQLCMD mode!

    Every script run through this tool is created with QUOTED IDENTIFIER OFF. We are the only module which uses indexed views. All the remaining stories you know well in my previous posts :(

    NOTE: I am going to vote everyone's post as useful.

提交回复
热议问题