I have hundreds of procedures that got installed to a database with quoted identifiers set to off and I need them set on. I'm able to view the list of these procedures using the following
SELECT name = OBJECT_NAME([object_id]), uses_quoted_identifier
FROM sys.sql_modules
WHERE uses_quoted_identifier <> 1 AND OBJECT_NAME([object_id]) LIKE '%%'
ORDER BY OBJECT_NAME([object_id])
Now I know I cannot do an update directly to sys.sql_modules to set the uses_quoted_identifier. I could manually open all the scripts and reinstall but that's time consuming. I could also probably make a batch file to run that same process but that's still time consuming albeit slightly less.
Is there an easier way I can go about updating these?
UPDATE While doing some more research I came across this post which made me realize, the quoted identifier stuff is all my own doing because I had a batch command already that was installing procedures from a specific directory: SET QUOTED IDENTIFIER should be ON when inserting a record
I realized using this article I can add -I to my sqlcmd to enable Quoted Identifiers: https://sqlsailor.com/2014/11/14/sqlcmdoptions/
I'll leave this question open for now incase any one has a trick to programmatically update the Quoted Identifiers on procedures but this should fix my issue for now.