Different collation settings are not scripted

Dec 13, 2009 at 9:15 AM

We discovered that when some tables have a different collation setting and the database is imported into the model the collation settings are lost. The generated script do not contain the collation settings.

Is this by design or are you planning this for a future release?

Dec 14, 2009 at 1:47 AM

There is no collation in the current version. I would like to discuss the details of your situation. Please contact me directly at chrisd@nhydrate.org.

Dec 15, 2009 at 1:28 AM

Please get the latest version. Now there is field level collation. When you import a database, if a field collation is different than database collation, the new value is stored in the column object's "collate" property. Only differences are stored. However after import, you can change a column's collation to any value desired. So after you have a model, you can change all string type field's collation (nvarchar, varchar, text, char, etc) to any value you wish. If a column's "collate" property is set, it will be generated out in the generate script.

So a quick recap, if you have a value in a column's collate property it is used in generation.

Dec 15, 2009 at 12:25 PM

Thanks for the quick response. We'll check the new bits as soon as possible.

Dec 16, 2009 at 6:39 AM

The solution is working partly. When setting the "Collate" property on a field in the model the collation item is perfectly scripted. But when you import the database again the "Collate" property is emptied from the model. Also when starting with an empty project the import function is not recognizing the collation setting on the fields. So you have to set the "Collate" property manually in the model.

Dec 16, 2009 at 12:27 PM

What you described is by design. When you start with a new model there is no way for it to know your desired collation so it is blank unless you set it. Also when you import a model the collation is set only if a field's collation is different from the database collation; otherwise it is left blank. In summary you only set the collation if you need to not all the time. Re-importing an existing model applies the same rules. If a field's collation if different than the database collation then it is imported with collation setting. Please define how you would like it to work. We can add a menu option to set all field's collation to a value. This might help you to re-set a specified value.