Popular Posts

Wednesday, 6 July 2011

Rename an AX company on SQL


Rename an AX company on SQL
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:

Post a Comment