SET QUOTED IDENTIFIER should be ON when inserting a record

前端 未结 4 1617
一整个雨季
一整个雨季 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:22

    In SQL Server 2005, SET QUOTED IDENTIFIER is OFF by default, not ON (unless using an ODBC or OLE connection...see this for more information).

    You do not need to create the table with SET QUOTED IDENTIFIER ON to use it.

    All you need to do is add SET QUOTED IDENTIFIER ON to the beginning of your SP to enable it for the run of the procedure (and make sure that if you don't wish to leave it on, you have SET QUOTED IDENTIFIER OFF to switch it back).

    EDIT

    I stand corrected. According to this MSDN Page, SET QUOTED IDENTIFIER is ON by default (unless connection with a DB-Library application.

提交回复
热议问题