0

I have a lot of scripts to run on a new database for creating all the stored procedures we need.

Problem: none of those scripts are setting ANSI_NULLS ON or QUOTED_IDENTIFIER ON and I need to set them on for every stored procedure

Is there a way to set these on dynamically, without going through all the files containing my scripts?

Tks

DJPB
  • 5,429
  • 8
  • 30
  • 44
  • And how do you run these scripts? If in SSMS just set ANSI_NULLS/IDETIFIERS in options once and run. https://i.stack.imgur.com/AmCSH.png – Lukasz Szozda Sep 04 '18 at 15:11
  • 2
    From [SET ANSI_NULLS (Transact-SQL)](https://learn.microsoft.com/en-us/sql/t-sql/statements/set-ansi-nulls-transact-sql?view=sql-server-2017): *"In a future version of SQL Server, ANSI_NULLS will be ON and any applications that explicitly set the option to OFF will generate an error. Avoid using this feature in new development work, and plan to modify applications that currently use this feature."* Why is `ANSI_NULL` off in the first place? It's set at connection level, which means *something* is changing that setting. – Thom A Sep 04 '18 at 15:11
  • Do any of these scripts explicitly turn off these settings? i.e. Do any of them contain ANSI_NULLS OFF or QUOTED_IDENTIFIERS OFF? – David Dubois Sep 04 '18 at 20:58

0 Answers0