notebook/IT/SQL/SCRIPTS SQL QSA ORSYS/divergence de collation.sql

12 lines
506 B
MySQL
Raw Normal View History

2020-11-26 17:38:25 +00:00
-- connaitre les bases ayant une collation diff<66>rente de celle du serveur
SELECT name, collation_name, SERVERPROPERTY('Collation') AS Server_collation
FROM sys.databases
WHERE collation_name <> SERVERPROPERTY('Collation')
-- bases ayant un AUTO close ou AUTO shrink
SELECT name, N'ALTER DATABASE [' + name + '] SET AUTO_CLOSE OFF;ALTER DATABASE [' + name + '] SET AUTO_SHRINK OFF;'
FROM sys.databases
WHERE database_id > 4
AND (is_auto_shrink_on = 1
OR is_auto_close_on = 1);