web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

Deleting a Company Completely from SL

(0) ShareShare
ReportReport
Posted on by 2,459

Does anyone know of a good tool (or back-end scripts) on how to delete a company completely from the SL system?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    The only idea I would have is to share the tables that contain the cpnyid field and then remove one by one from each of the tables where cpnyid = 'xxxx'

    SET QUOTED_IDENTIFIER OFF

    GO

    DECLARE @tablename varchar(30)

    DECLARE tables_cursor CURSOR

      FOR

    select name from sysobjects where xtype = 'U' and id in (select id from syscolumns where name = 'Cpnyid')

    order by name

    OPEN tables_cursor

    FETCH NEXT FROM tables_cursor INTO @tablename

    WHILE @@FETCH_STATUS = 0

    BEGIN

    PRINT  @tablename

    FETCH NEXT FROM tables_cursor INTO @tablename

    END

    CLOSE tables_cursor

    DEALLOCATE tables_cursor

    SET QUOTED_IDENTIFIER ON

    GO

    Here is a script to find all of the tables that contain a particular field name like Cpnyid

  • SU-22040800-0 Profile Picture
    2,459 on at

    Thanks Elaine

    I am communicating with the customer as well, and will possibly log a direct call with Microsoft surrounding this. (just so its official)

    Thanks a mil!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans