Check constraint SQL code generation issues (Universal -> Physical MS SQL)

Hello, In my Universal model the check constraint code looks like this

<%ColumnName%> IN (‘M’,‘C’)

When I sync and convert it to Physical model, target database = MS SQL Server 2014, for some reason the code gets converted with “–” prefix, essentially TOAD puts comments in there

–<%ColumnName%> IN (‘M’,‘C’)

This causes my SQL script generated from physical DM to fail when executed

Any suggestions?

Hello Alexey,

TDM by default comments out database specific code. There is an option to disable this setting by unchecking Comment Out Database Specific Items in the second dialog of Model Convesion wizard (it’s called Conversion Settings, just after selecting the target database). After that, the check constraint will be converted without being commented out.



Thank you! it is better now. A follow-up question if I may. When I originally generated Physical from Universal, assigned it to particular database version and made some adjustments to the underlying data types (e.g. specified Identity columns for MS SQL etc.)

Can I sync the physical with changes I made on Universal? I find it hard to re-generate physical models every now and then. Does Toad DM provide any equivalent to complete compare which ErWin has?

Unfortunately you cannot compare Universal and Physical model just as you cannot compare two Physical models of two different database platforms (e.g. MS SQL and Oracle). It’s the same thing.

There is a solution, though. After you make changes to your Universal model, convert it to MS SQL Physical model and then Compare this model with the first MS SQL model. Then you can use Model Merge to transfer the changes from one model to another.

will try that, thanks for the hint. Although suspect the comparison will show all attributes which I specifically hand crafted in physical to a different datatypes as mismatches