# Database schema - Table and fields

**URL:** <https://www.epiusers.help/t/database-schema-table-and-fields/44237>\
**Category:** Epicor ERP 9\
**Created:** [April 25, 2018, 7:47pm UTC](https://www.epiusers.help/t/database-schema-table-and-fields/44237 "2018-04-25T19:47:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![cchang](https://www.epiusers.help/user_avatar/www.epiusers.help/cchang/32/13056_2.png) [@cchang](https://www.epiusers.help/u/cchang)\
**Post date:** [April 25, 2018, 7:47pm UTC](https://www.epiusers.help/t/database-schema-table-and-fields/44237/1 "2018-04-25T19:47:22Z")

</div>

What is the best way to find a database schema that lays out every table and field in Epicor?

---

<div class="post-metadata">

**Author:** ![josephmoeller](https://www.epiusers.help/user_avatar/www.epiusers.help/josephmoeller/32/81429_2.png) [@josephmoeller](https://www.epiusers.help/u/josephmoeller)\
**Post date:** [April 25, 2018, 8:58pm UTC](https://www.epiusers.help/t/database-schema-table-and-fields/44237/2 "2018-04-25T20:58:17Z")

</div>

If you’re looking for Epicor-provided system information, I would take a look at the data dictionary form which should be within the system maintenance menu.

---

<div class="post-metadata">

**Author:** ![cchang](https://www.epiusers.help/user_avatar/www.epiusers.help/cchang/32/13056_2.png) [@cchang](https://www.epiusers.help/u/cchang)\
**Post date:** [April 25, 2018, 9:03pm UTC](https://www.epiusers.help/t/database-schema-table-and-fields/44237/3 "2018-04-25T21:03:54Z")

</div>

Is there a table to do a sql query lookup of all the tables and fields?

---

<div class="post-metadata">

**Author:** ![josephmoeller](https://www.epiusers.help/user_avatar/www.epiusers.help/josephmoeller/32/81429_2.png) [@josephmoeller](https://www.epiusers.help/u/josephmoeller)\
**Post date:** [April 25, 2018, 9:14pm UTC](https://www.epiusers.help/t/database-schema-table-and-fields/44237/4 "2018-04-25T21:14:34Z")

</div>

It sounds like you want to execute this general SQL after selecting your Epicor database:  
`SELECT o.name AS tbl, c.name AS col, t.name AS type, t.max_length AS size`  
`FROM sys.objects AS o`  
`INNER JOIN sys.columns AS c ON o.object_id = c.object_id`  
`INNER JOIN sys.types AS t ON c.system_type_id = t.system_type_id`  
`WHERE o.type_desc = 'USER_TABLE'`

The query should return the table, column, type, and size for the tables in the database.

---

<div class="post-metadata">

**Author:** ![dmoon](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/278dde/32.png) [@dmoon](https://www.epiusers.help/u/dmoon)\
**Post date:** [April 25, 2018, 9:17pm UTC](https://www.epiusers.help/t/database-schema-table-and-fields/44237/5 "2018-04-25T21:17:36Z")

</div>

Also, this is a good article

> **[sys.columns (Transact-SQL) - SQL Server](https://learn.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-columns-transact-sql?view=sql-server-2017)**
>
> sys.columns (Transact-SQL)

---

<div class="post-metadata">

**Author:** ![danbedwards](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/9f8e36/32.png) [@danbedwards](https://www.epiusers.help/u/danbedwards)\
**Post date:** [April 25, 2018, 9:18pm UTC](https://www.epiusers.help/t/database-schema-table-and-fields/44237/6 "2018-04-25T21:18:13Z")

</div>

Did you take a look at this?

> **[Table relationship diagram](https://www.epiusers.help/t/table-relationship-diagram/33892/4)**
>
> What version are you on?  I just notices today that the Pack slip RDD (which drives the labels too) involves 25 tables.  Blew me away.  Just for that RDD it is pretty messy and probably overkill for a simple label.  Probably...

---

<div class="post-metadata">

**Author:** ![cchang](https://www.epiusers.help/user_avatar/www.epiusers.help/cchang/32/13056_2.png) [@cchang](https://www.epiusers.help/u/cchang)\
**Post date:** [April 25, 2018, 9:24pm UTC](https://www.epiusers.help/t/database-schema-table-and-fields/44237/7 "2018-04-25T21:24:21Z")

</div>

Is there a field description column that can be included in the sql query?

---

<div class="post-metadata">

**Author:** ![aidacra](https://www.epiusers.help/user_avatar/www.epiusers.help/aidacra/32/17997_2.png) [@aidacra](https://www.epiusers.help/u/aidacra)\
**Post date:** [April 25, 2018, 9:44pm UTC](https://www.epiusers.help/t/database-schema-table-and-fields/44237/8 "2018-04-25T21:44:40Z")

</div>

zdatafield.dbtablename, zdatafield.dbfieldname,zdatafield.description contains most of what you are looking for.

---

<div class="post-metadata">

**Author:** ![josephmoeller](https://www.epiusers.help/user_avatar/www.epiusers.help/josephmoeller/32/81429_2.png) [@josephmoeller](https://www.epiusers.help/u/josephmoeller)\
**Post date:** [April 26, 2018, 12:45am UTC](https://www.epiusers.help/t/database-schema-table-and-fields/44237/9 "2018-04-26T00:45:03Z")

</div>

I was waiting until I got home to post what @aidacra just posted. This is the Epicor listing of the tables and fields as organized by the application.

---

<div class="post-metadata">

**Author:** ![Cycl3](https://www.epiusers.help/letter_avatar_proxy/v4/letter/c/5e9695/32.png) [@Cycl3](https://www.epiusers.help/u/Cycl3)\
**Post date:** [April 26, 2018, 8:58am UTC](https://www.epiusers.help/t/database-schema-table-and-fields/44237/10 "2018-04-26T08:58:08Z")

</div>

I stopped using the Data Dictionary for quite a while, it is just inconvenient  
There’s probably one from old yahoo group, generated by HtmlDict, like this but at E905  
[http://epidd.wisconsinconverting.com/](http://epidd.wisconsinconverting.com/)  
It doesn’t have graphs or ER diagram, but at least you can see descriptions, and a list of tables having the same fieldname.

---

<div class="post-metadata">

**Author:** ![kalbee](https://www.epiusers.help/letter_avatar_proxy/v4/letter/k/bbe5ce/32.png) [@kalbee](https://www.epiusers.help/u/kalbee)\
**Post date:** [April 27, 2018, 3:50pm UTC](https://www.epiusers.help/t/database-schema-table-and-fields/44237/11 "2018-04-27T15:50:54Z")

</div>

I actually created a dashboard from a query that utilizes the “zDataTable” and “zDataField” tables along with a tracker Matches(\*) criteria fields on the table/field name/description. These tables list out all of the tables and field located in the database. These are the fields that I utilize in the tables you’re probably looking for:

zDataTable.DBTableName, zDataTable.Description  
zDataField.FieldName, zDataField.Description, zDataField.DataType
