Rename an AX company on SQL

February 24, 2010 at 22:57
filed under Dynamics AX
Tagged ,

A while ago, I talked about deleting an AX company on SQL, but of course, you can also use the sp_MSforeachtable stored procedure to rename a company (= change the DataAreaId of a company).

In the next example, I rename CEE to CEA:

exec sp_MSforeachtable 'update ? set DataAreaID = "CEA" where ?.DataAreaID = "CEE"'

UPDATE DataArea SET ID = 'CEA' WHERE DataArea.ID = 'CEE'
UPDATE CompanyDomainList SET CompanyID = 'CEA' WHERE CompanyID = 'CEE'

no comments

RSS / trackback

respond