Regenerate Data Model error

I’m getting a weird error when trying to regen our data, we’re trying to expand a string field from x8 to x1000. I think the money shot error is: ALTER TABLE ALTER COLUMN UDField_c failed because one or more objects access this column.

Anyone got ideas how to track down the objects that reference a field? I’ve checked BPMs and form customizations and none do.

Full text of log:

> Start time: 6/22/2017 10:33:38 AM
> Database server: SERVER_NAME
> Database name: DBName
> Using Windows authentication: False
> User ID: *****
> Schemas to include:
> Tables to exclude: Ice.SysSequence, Ice.DBMigrationLog
> Generator version: 3.1.600.0
> Server version: 3.1.600.3
> Folder C:\Users\username\AppData\Local\Temp\Epicor\DataModelGenerator\Source is deleted successfully.
> Extracting "Epicor.ServiceModel.dll" from "C:\Program Files (x86)\Common Files\Epicor Software\Database Manager Extensions\3.1.600\DataModelGenerator\..\DbMigration.zip" to "C:\Users\username\AppData\Local\Temp\Epicor\DataModelGenerator\Deployment\Server\Bin".
> Extracting "Epicor.System.dll" from "C:\Program Files (x86)\Common Files\Epicor Software\Database Manager Extensions\3.1.600\DataModelGenerator\..\DbMigration.zip" to "C:\Users\username\AppData\Local\Temp\Epicor\DataModelGenerator\Deployment\Server\Bin".
> Synchronizing schema changes.
> The object 'DF__Customer___udCon__5909FD01' is dependent on column 'UDField_c'.
> ALTER TABLE ALTER COLUMN UDField_c failed because one or more objects access this column.
> ALTER TABLE [Erp].[Customer_UD] ALTER COLUMN [UDField_c] nvarchar(max) NOT NULL
> EXEC Ice.DropColumn N'Erp', N'Customer_UD', N'UDField_c', 1
> ALTER TABLE [Erp].[Customer_UD] ADD CONSTRAINT [DF_Customer_UD_UDField_c] DEFAULT '' FOR [UDField_c]

> Error Generating the Data Models: The following tables were not synchronized due to errors. Review the log for more detailed information. Tables:
> Erp.Customer_UD

Is there data in this field currently?

No, it’s a pre-production database we’re setting up for 10.1 migration testing from 10.0. We’re doing a DMT migration do remove avoid some bad data from the pre-Epicor ERP system conversion.

In fact, this DB has no customers loaded yet.

Upgrading to a Major version seems dangerous =) they must have introduced Constraints to the database in 600 and could most definitely be a bug now. You could fix it by dropping the Contraints via SQL but then the question remains “what else is broken or ties to this error”.

If I recall atleast in SQL its ALTER TABLE yourtable DROP CONSTRAINT DF__Customer___udCon__5909FD01

1 Like

Try taking a look at the related table in SSMS, Right mouse click and click View Dependencies.

1 Like

What Hally said in addition in the screenshot notice the Contraints folder, check that too.

1 Like

Appears it may be a bug, I put a ticket in with Support and we’re working on it with them.

5 Likes

Hello… Did Support ever gave you an answer on this?

Thanks!

There was a different thread that indicated that if one creates custom Views in your SQL Server that it can cause the rebuild not to work.

Mark W.

1 Like

@Dora,

We tripped on a bug when trying to expand the size of a text UD field. The “fix” was to delete the UD field, regenerate the data model, then add the UD field back in with the new size. We could do this because it was a new DB without any data yet.

I believe this has been fixed now in later releases.

2 Likes