Is there a way to check if a particular model type is used in some of the databases of one server? The model type is in the filter. The filter is used by all databases. However, the question is to find if there are any models created using that particular model type. The intention is to avoid checking each database as their number is big. Does anybody know a way to run script and check all DBs, or merge automatically all into one, with predefined setting for conflict resolution, or some other way as long as it's quicker than checking a big number of DBs one by one.
Hello,
You can use this script to connect to all dbs of one server and output the number of models of the selected type.
Hope this helps...
var output = Context.createOutputObject(); var allDbNames = ArisData.GetDatabaseNames(); for (var i = 0; i < allDbNames.length; i++){ var oCurrentDB = ArisData.openDatabase(allDbNames[i], "system", "xxx", "dd838074-ac29-11d4-85b8-00005a4053ff", Context.getSelectedLanguage(), true); if (oCurrentDB != null){ var allModelsOfType = oCurrentDB.Find(Constants.SEARCH_MODEL,Constants.MT_EEPC); if (allModelsOfType.length > 0){ output.OutputTxt(allDbNames[i]+": " + allModelsOfType.length+"\r\n"); } oCurrentDB.close(); }else{ output.OutputTxt(allDbNames[i]+": NO CONNECTION\r\n"); } } output.WriteReport();