Skip to main content

Notifications

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,434

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

  • SU-22040800-0 Profile Picture
    2,434 on at
    RE: Deleting a Company Completely from SL

    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!

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Deleting a Company Completely from SL

    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

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

#1
Community Member Profile Picture

Community Member 136

#2
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 102 Super User 2025 Season 1

#3
REUser Profile Picture

REUser 8

Featured topics

Product updates

Dynamics 365 release plans