Epicor 10 Regenerating the datamodel error in our test database

Received an error while attempting to regenerate the datamodel in our test environment. Where would one begin to see what would cause this error message? (From the error log)
This is the error in the log file ……
Error Generating the Data Models: Unexpected data type: varchar
Saving EDMX
save completed. (0.10 s)
Transform Model T4 template
transformation completed. (7.70 s)
Transform TempRowTypes T4 template
transformation of TempRowTypes completed. (0.53 s)
Build context project
build project completed. (9.11 s)
Total generation time (21.39 s)
Copying generated assembly to database: C:\Users\administrator.LESUEURINC\AppData\Local\Temp\2\Epicor\DataModelGenerator\Source\Server\Db\Ice.Data.Model\obj\Release\Ice.Data.Model.dll
Generating: C:\Users\administrator.LESUEURINC\AppData\Local\Temp\2\Epicor\DataModelGenerator\Source\Server\Db\Erp.Data.910100\ErpContext.edmx
Connecting to server/database: LSIEPICOR10/LSIE10TEST
connection opened and DB info retrieved. (24.14 s)
Generate EDMX

I’ve never seen a problem with this utility unless it was a field that I added (UD Column Maintenance) and I goofed something up.

I know its heresy, but have you checked there are no custom objects in your ERP schema?

1 Like

Some people have seen this type of error when adding a VIEW within the Epicor schema. Any database changes using SSMS?

Must have some hiccup somewhere. Went through the process again and it worked fine.

1 Like

I will have to check into that. Thanks for the suggestion!

Carol

Thank you all for you suggestions. There were no view that were added within the Epicor schema.
We stopped and started the services and went through the process again and all was fine.
I certainly appreciate this group though and all of the support we obtain from you gurus :slight_smile:
Carol

I received the same message again that there is an unexpected data type “var char” . when I regenerated the datamodel… could I run a sequel query to see if there is some garbage out there?

Not even sure why you are using varchar - make sure you select from the drop-down in UD Column Maintenance, usually you pick nvarchar (notice the n), perhaps you force typed in varchar.

image

1 Like

That is what I always do. Possibly one of the users inadvertently typed it in rather than selecting. How can I find out which UD field has the error. I’ve parsed through the error log, but am not finding anything.

If it is a problem stemming from UD column maintenance and you have access to SQL server:

select * from ice.ZDataField with (nolock) where systemflag = 0 and DataType = 'varchar'

Thank you Tanner!

Hi Tanner,

I ran the below in Sequel Management studio and the query executed but no records were returned.

Totally puzzled.

No records were returned, so we are going to try updating the schema (this is in our test environment … thank goodness). I will keep the forum posted on the results in case anyone else ever runs into this.

Sorry it didn’t work. You could try looking at the system fields as well.

select * from ice.ZDataField with (nolock) where systemflag = 1 and DataType = 'varchar'

If that yields no results, you may also be able to find the problematic field(s) by doing a query on the metadata:

SELECT c.* from INFORMATION_SCHEMA.columns c
INNER JOIN INFORMATION_SCHEMA.tables t ON t.table_name = c.table_name
WHERE c.data_type = 'varchar' AND t.table_type = 'base table'

See if you see anything weird in any of the DataType columns, it could even be a blank.

select * from ice.ZDataField with (nolock) where systemflag = 0 order by DataType

Tanner …. Thank you very much for suggestion on querying the metadata.

I think we found the culprit. One record was returned with a data type of varchar … after this is corrected we will regenerate the data model and I am sure it will be successful.

Thanks to all the help forum for the suggestions!!

Carol

1 Like

Mark,
Apologies for dragging up an old thread, this looks to be the exact issue we have, our developer has started to copy some views from 9 to Kinetic, i have created some UD fields in our Pilot environment (Same environment as where he has created views) and i am getting the varchar error.

What is the solution to this?

Many thanks,

Daniel

Sorry Daniel, I was out yesterday. But I’m the annoying guy who preaches not to do stuff in the database. :stuck_out_tongue_winking_eye:

I believe what @tanner and @hkeric.wci posted should help you out.