February 24, 2010 at 22:57
filed under Dynamics AX
Tagged Dynamics AX, 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:
Severin
on July 3, 2013 at 10:07
Does it work for Dynamics AX 2012 R2?
kind regards,
Severin
Klaas Deforche
on July 3, 2013 at 10:12
Hi Severin,
I don’t know, I never tested this with R2 (I don’t have R2 installed at the moment either).
Just try it out on a backup :).
Vaibhav
on September 23, 2013 at 12:29
Hi Severin,
Did you tried it with Dynamics AX 2012 R2?
Regards
Vaibhav
Petr Janik
on March 27, 2014 at 16:01
Hi,
I think it works neither for AX2012 nor AX2009. For example, the table SpecTrans has two fields (SpecCompany, RefCompany) with DataAreaId of company.
Regards
Petr Janik
Klaas Deforche
on March 27, 2014 at 17:04
Hi Petr,
Thank you for your comment.
That’s correct, tables that contain a refcompany field will not be converted correctly.
Either way, I wouldn’t really recommend using this method other that in your dev environment with little data for example.
My intention is more to demonstrate the use of the EXEC sp_MSforeachtable procedure.