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. This is a good article & good site.Thank you for sharing this article. It is help us following categorize:
    healthcare, e commerce, programming, multi platform,inventory management, cloud-based solutions, it consulting, retail, manufacturing, CRM, technology means, digital supply chain management, Delivering high-quality service for your business applications,
    Solutions for all Industries,
    Getting your applications talking is the key to better business processes,
    Rapid web services solutions for real business problems,
    Web-based Corporate Document Management System,
    Outsourcing Solution,
    Financial and Operations Business Intelligence Solution,

    Our address:
    2002 Timberloch Place, Suite 200
    The Woodlands, TX 77380
    281-364-1799

    prologic-corp

    ReplyDelete