# Regenerate Data Model error

**URL:** <https://www.epiusers.help/t/regenerate-data-model-error/38952>\
**Category:** Epicor ERP 10\
**Created:** [June 22, 2017, 4:19pm UTC](https://www.epiusers.help/t/regenerate-data-model-error/38952 "2017-06-22T16:19:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Randy](https://www.epiusers.help/user_avatar/www.epiusers.help/randy/32/51539_2.png) [@Randy](https://www.epiusers.help/u/Randy)\
**Post date:** [June 22, 2017, 4:19pm UTC](https://www.epiusers.help/t/regenerate-data-model-error/38952/1 "2017-06-22T16:19:28Z")

</div>

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
```

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [June 22, 2017, 4:24pm UTC](https://www.epiusers.help/t/regenerate-data-model-error/38952/2 "2017-06-22T16:24:15Z")

</div>

Is there data in this field currently?

---

<div class="post-metadata">

**Author:** ![Randy](https://www.epiusers.help/user_avatar/www.epiusers.help/randy/32/51539_2.png) [@Randy](https://www.epiusers.help/u/Randy)\
**Post date:** [June 22, 2017, 4:43pm UTC](https://www.epiusers.help/t/regenerate-data-model-error/38952/3 "2017-06-22T16:43:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hkeric.wci](https://www.epiusers.help/user_avatar/www.epiusers.help/hkeric.wci/32/52019_2.png) [@hkeric.wci](https://www.epiusers.help/u/hkeric.wci)\
**Post date:** [June 23, 2017, 7:42am UTC](https://www.epiusers.help/t/regenerate-data-model-error/38952/4 "2017-06-23T07:42:03Z")

</div>

> [@Randy](#):
>
> failed because one or more objects access this column

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

---

<div class="post-metadata">

**Author:** ![Hally](https://www.epiusers.help/user_avatar/www.epiusers.help/hally/32/1263_2.png) [@Hally](https://www.epiusers.help/u/Hally)\
**Post date:** [June 23, 2017, 7:46am UTC](https://www.epiusers.help/t/regenerate-data-model-error/38952/5 "2017-06-23T07:46:24Z")

</div>

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

![](https://epiusers.help/uploads/default/original/2X/1/1d0a4192359230d6ba6bdb046073b7ca2f0feaf6.png)

---

<div class="post-metadata">

**Author:** ![hkeric.wci](https://www.epiusers.help/user_avatar/www.epiusers.help/hkeric.wci/32/52019_2.png) [@hkeric.wci](https://www.epiusers.help/u/hkeric.wci)\
**Post date:** [June 23, 2017, 7:47am UTC](https://www.epiusers.help/t/regenerate-data-model-error/38952/6 "2017-06-23T07:47:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Randy](https://www.epiusers.help/user_avatar/www.epiusers.help/randy/32/51539_2.png) [@Randy](https://www.epiusers.help/u/Randy)\
**Post date:** [June 23, 2017, 1:48pm UTC](https://www.epiusers.help/t/regenerate-data-model-error/38952/7 "2017-06-23T13:48:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dora](https://www.epiusers.help/user_avatar/www.epiusers.help/dora/32/960_2.png) [@Dora](https://www.epiusers.help/u/Dora)\
**Post date:** [May 15, 2018, 1:29pm UTC](https://www.epiusers.help/t/regenerate-data-model-error/38952/8 "2018-05-15T13:29:01Z")

</div>

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

Thanks!

---

<div class="post-metadata">

**Author:** ![Mark\_Wonsil](https://www.epiusers.help/user_avatar/www.epiusers.help/mark_wonsil/32/51594_2.png) [@Mark\_Wonsil](https://www.epiusers.help/u/Mark_Wonsil)\
**Post date:** [May 15, 2018, 1:35pm UTC](https://www.epiusers.help/t/regenerate-data-model-error/38952/9 "2018-05-15T13:35:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Randy](https://www.epiusers.help/user_avatar/www.epiusers.help/randy/32/51539_2.png) [@Randy](https://www.epiusers.help/u/Randy)\
**Post date:** [May 15, 2018, 2:56pm UTC](https://www.epiusers.help/t/regenerate-data-model-error/38952/10 "2018-05-15T14:56:35Z")

</div>

> [@Dora](#):
>
> Did Support ever gave you an answer on this?

@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.
