Hi Chandan,
Ax doesn't try to synch the table (generating the appropriate sql statement to add modify fields) comparing the cuurent layout in the database with the layout in the aot. (modelstore)
Instead a "helper" table is used within the normal ax database - sqldictionary.
It seems in your case, that ax thinks it has a field TRI_ONHANDLENGTH (which isn't really part of that table) because there is an entry within sqldictionary (did you mix up model databases and normal databases from different environments?)
The content of that table (for the inventdim table) doesn't seem to match the current structure as seen from aot/model sight.
So you have to repair the sqldictionary to match the current structure
Lets take a look using SSMS
select F.* from SQLDICTIONARY F
where F.FIELDID != 0
AND F.TABLEID =
(select TABLEID from SQLDICTIONARY
where FIELDID=0
and NAME='INVENTDIM'
)
The output shows what ax currently thinks it has. Maybe there is an entry for the decribed field here.
=== do not do the following in production ========================
Here is one way to rebuild the table (but only do this if you can't overcome the problem repairing the sqldictionry entires in a testsystem)
- make a copy (or rename) the table in ssms. delete all indices on that renamed table.
You will not habe a InventDim at this moment
- now delete all inventdim related entries from sqldictionry table
delete from SQLDICTIONARY
where SQLDICTIONARY.TABLEID =
(select A.TABLEID from SQLDICTIONARY A
where A.FIELDID=0
and A.NAME='INVENTDIM'
)
- now sync inventdim. Ax generates a fully create table with all fields command.
- now you have a fresh but empty inventdim within database.
now copy the data from the copied (or renamed table) back to the empty inventdim using the export import table data tool from sql server or issue a single insert command by yourself
insert into inventdim (field1, field , ......)
select field, field, ......
from copiedoldinventdim
regards
Douglas