查找存储过程QUOTED_IDENTIFIER属性
作者:[51ak ]
/*
查找服务器上所有数据库QUOTED_IDENTIFIER=0的脚本
*/
use master
declare @dbname varchar(255)
declare @dbs table
(dbname varchar(255))
insert into @dbs(dbname)
Select name from master.sys.sysdatabases where name not in('master','tempdb','model','msdb','Northwind','distribution') and [version]<>0
while exists(Select dbname from @dbs)
begin
Select top 1 @dbname=dbname from @dbs
exec ('Select '''+@dbname+''' as dbname,b.[object_id],b.[name] from '+@dbname+'.sys.sql_modules a,
'+@dbname+'.sys.objects b where a.[object_id]=b.[object_id] and b.[type]=''P'' and a.uses_quoted_identifier=0')
delete @dbs where dbname=@dbname