Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

How can I change Company ID

(0) ShareShare
ReportReport
Posted on by 40

Hi Guys. I am preparing a base database that includes all the customization which we will be using for 10 companies. But, my problem is I need to change the company id for each company. Is it possible to create just one application and system database that I can use for 10 companies and just restore it to another database name for another company and change the company Id? If yes, may I know all the tables that I need to update the company id? Is it safe to do this? 

Thanks.

*This post is locked for comments

  • Suggested answer
    Jeff Trotman Profile Picture
    Jeff Trotman 275 on at
    Re: How can I change Company ID

    If you run this in your application database, it will show you every table/field combination that has CpnyID as part of the field name, which is probably pretty close to what you are looking for.

    select o.Name, c.Name
    from sys.columns c inner join sys.objects o on c.object_id = o.object_id
    where o.type = 'U' and c.name like '%CpnyID%'
    order by o.Name

    Having said that, regarding your question about "safe" - I would definitely say you do what you are suggesting at your own risk.  If you are not very comfortable with the SL database structure, I would say you probably don't want to do this.

    I think the "safe" option would be to use a SQL tool that will find differences in databases and will script out the differences.  You could set up an "out of the box" database and compare it to your customized one and let it generate the scripts for the differences and then apply that to the other 9.  That's probably the safe way to go.

    APEX, Embarcadero, and Quest (off the top of my head) make these kind of tools.  I've had good luck with this one - http://www.sql-server-tool.com/?src=sct#rd0. It's cheap and not as powerful, but will do what I'm talking about here.

    Another option is to use the Professional Service Tools Company ID modifier, but it would only change values in the standard SL tables, not your custom tables.

  • catherine chua Profile Picture
    catherine chua 40 on at
    Re: How can I change Company ID

    Hi Nayan,

    Thanks for the reply. I can do that but there are customized tables, stored procedures, functions & triggers and PV list involve in the customization. Is there a simple way or scripts to get all the customized table, store procedure, functions and triggers?

    Thanks

  • Nayan Mansinha Profile Picture
    Nayan Mansinha 1,245 on at
    Re: How can I change Company ID

    If I understood correctly your question:

    "You have customizations that you want to apply to 10 different companies"

    then, I would suggest the following:

    1) Export out all the customizations using Export Customizations (91.500.00) screen and then

    2) Import them in (using 91.510.00) all the other companies.

    HTH

    Nayan

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans