Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Script the stored proc, ensure/change SET options, run the ALTER PROC to ensure SET QUOTED IDENTIFIER ON is set.</p> <p><strong>Why?</strong></p> <p>The setting of "SET QUOTED IDENTIFIER" is defined at creation time for stored procs and is always "ON" for tables. <a href="http://msdn.microsoft.com/en-us/library/ms174393(SQL.90).aspx" rel="nofollow noreferrer">Source, BOL</a>.</p> <blockquote> <p>When a table is created, the QUOTED IDENTIFIER option is always stored as ON in the table's metadata even if the option is set to OFF when the table is created.</p> <p>When a stored procedure is created, the SET QUOTED_IDENTIFIER and SET ANSI_NULLS settings are captured and used for subsequent invocations of that stored procedure.</p> </blockquote> <p>The default for connections can be defined at the server level (sp_configure 'user options') or database level (ALTER DATABASE). For SSMS, it's under "Tools..Options.. Query Execution..SQL Server..ANSI". It's also the default for client libraries too (except DB-LIb).</p> <p>Now, it you open an SSMS Query Window and start typing "CREATE PROC.." then it uses SSMS settings when you run the code.</p> <p>And SET QUOTED IDENTIFIER <strong><em>can not</em></strong> be set at run time inside the stored proc. Show me the a reference before you disagree... From the MS BOL link above:</p> <blockquote> <p>When executed inside a stored procedure, the setting of SET QUOTED_IDENTIFIER is not changed.</p> </blockquote> <p>You have to work hard to run any code with this OFF... so the most likely fix is to ALTER or re-create the stored proc.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload