Tuesday, May 10, 2011

Microsoft SQL Server T-SQL : Delete AX 2009 Company Query


Microsoft Dynamics AX 2009 Company can also be deleted from the database using a SQL T-SQL Query, if you ever encounter issues while deleting a company from Microsoft Dynamics AX 2009 Administration settings than you may use the following T-SQL Query code for company deletion.

Note: Please make sure to first take the Microsoft Dynamics AX 2009 full database backup and use the query on a test environment.
[T-SQL Code Snippet]

  
--Replace DynamicsAX2009 with your Dynamics AX 2009 Database Name
USE [DynamicsAX2009]
 
--Replace CEU with Company Id that is required to be deleted
DELETE FROM DataArea WHERE DataArea.ID = 'CEU'
--Replace CEU with Company Id that is required to be deleted
DELETE FROM CompanyDomainList WHERE CompanyDomainList.CompanyID = 'CEU'
--Replace CEU with Company Id that is required to be deleted
EXEC sp_MSforeachtable 'delete from ? where ?.DataAreaID = "CEU"'
  


1 comment:

  1. Microsoft Dynamics AX 2009 Company can also be deleted from the database using a SQL T-SQL Query, if you ever encounter issues while deleting a company from Microsoft Dynamics AX 2009 Administration settings than you may use the following T-SQL Query code for company deletion.
    cotton king comforter set ,
    black and white bedding king ,

    ReplyDelete