How to Delete NAV Company on SQL Database

denden Member Posts: 7
Hi,

We're using NAV 2018 and we have multiple companies on our database.
We want to delete a certain company including all data on it, we've already deleted it on NAV RTC but when we look on the SQL database all tables and views are still there. Is there a way to delete a company and all of its records in a simple way?.

Thanks in advance.

Answers

  • Tony_NCDTony_NCD Member Posts: 32
    How did you delete the company under the NAV RTC? I just tried deleting a company in my demo database, it deleted all related tables immediately for me. Perhaps you can try using the development environment to do a Tools > Sync. Schema For All Tables > With Validation to see if it helps?
  • denden Member Posts: 7
    Tony_NCD wrote: »
    How did you delete the company under the NAV RTC? I just tried deleting a company in my demo database, it deleted all related tables immediately for me. Perhaps you can try using the development environment to do a Tools > Sync. Schema For All Tables > With Validation to see if it helps?

    I go to the Company, select the company then click the Delete button.

    I also tried to sync schema for all tables then got a prompt state "operational"
    I look again on the SQL database but still, all tables are there

  • RockWithNAVRockWithNAV Member Posts: 1,139
    If it' successful from NAV Side than you don't have to worry from SQL Side.
  • Tony_NCDTony_NCD Member Posts: 32
    Did you get any warning or errors when deleting? Make sure the RTC instance you're on is actually connected to the DB you're expecting the tables to be deleted from. Or it could be the other way around, where you're checking the wrong DB. I suggest creating a demo DB and then deleting the company and checking to see if this drops the tables you're expecting to be dropped. If it does and you did the same steps, then, at least you know you did it the correct way! ;)
  • denden Member Posts: 7
    Hi Guys,

    As per checking again today on the database, all tables are now deleted.
    Not sure if sync. schema do the work or it just really took a long time before it will be deleted. But anyway thank you for your help. :)
  • Anita2020Anita2020 Member Posts: 4
    Hello,

    Do you want to delete NAV Company on SQL Database, then please go through this link:
    https://docs.microsoft.com/en-us/powershell/module/microsoft.dynamics.nav.management/remove-navcompany?view=businesscentral-ps-16

    Thanks & Regards,
    Anita
Sign In or Register to comment.