RE: How to delete Microsoft Dynamics CRM 365 Organization in SQL
Hi
The recommended approach to delete a CRM Org is to disable and delete it from the Deployment Manager.
Please see the link below
docs.microsoft.com/.../delete-an-organization
As explained in the page, the SQL DB will not be deleted automatically, for recovering from accidental deletion of Organization. But you can open the SSMS and delete the database manually.
If you want to automatically do both, you could consider doing the whole thing in a PowerShell script
First you can disable and delete the org in a supported way and then
"You can implement the procedure described here by using a Windows PowerShell cmdlet. For more information, see the Disable-CrmOrganization and Remove-CrmOrganization commands."
And you can include steps in your powershell script to delete database as well
https://stackoverflow.com/questions/24149363/drop-sql-server-database-from-powershell
I would recommend, you do a backup of the DB before you delete it automatically