changeset 504:fe1897618c08

fix: only alter database when needed
author Christian Binder <christian.binder@varian.com>
date Mon, 13 May 2024 13:08:22 +0200
parents a164d8aebe0e
children 38e428f8179d
files Framework/Odbc/OdbcDatabase.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Odbc/OdbcDatabase.cpp	Fri May 03 16:23:36 2024 +0200
+++ b/Framework/Odbc/OdbcDatabase.cpp	Mon May 13 13:08:22 2024 +0200
@@ -618,7 +618,7 @@
            * "odbc-index" cannot start because it doesn't have
            * exclusive access.
            **/
-          db->ExecuteMultiLines("ALTER DATABASE CURRENT COLLATE LATIN1_GENERAL_100_CI_AS_SC_UTF8");
+          db->ExecuteMultiLines("IF 'Latin1_General_100_CI_AS_SC_UTF8' != (SELECT CONVERT (varchar(256), DATABASEPROPERTYEX(DB_NAME(),'collation'))) ALTER DATABASE CURRENT COLLATE LATIN1_GENERAL_100_CI_AS_SC_UTF8");
         }
         
         return db.release();