asooft
Posts: 2
Joined: Tue Aug 07, 2018 2:53 pm

drop sql database after uninstall

Hi,

Please i want the way to drop sql database after uninstall my package

i tried sql line and command "drop database xxx" but the error "the database can't be dropped because it run now"

what is the solution?
Catalin
Posts: 6597
Joined: Wed Jun 13, 2018 7:49 am

Re: drop sql database after uninstall

Hello and welcome to Advanced Installer forums,

I have tested your scenario using our predefined support for "SQL Databases" where I have ran an "SQL Script" with the DROP DATABASE <DatabaseName> SQL statemenet and everything worked as expected.

I suggest you to try to manually run your script using the argument you have specified above and see if that works. If that's the case, in order for me to further investigate, can you please send us the .aip (project file) and a "verbose log" of the installation by e-mail at support at advancedinstaller dot com so we can investigate its settings?

Regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
asooft
Posts: 2
Joined: Tue Aug 07, 2018 2:53 pm

Re: drop sql database after uninstall

Catalin wrote:Hello and welcome to Advanced Installer forums,

I have tested your scenario using our predefined support for "SQL Databases" where I have ran an "SQL Script" with the DROP DATABASE <DatabaseName> SQL statemenet and everything worked as expected.

I suggest you to try to manually run your script using the argument you have specified above and see if that works. If that's the case, in order for me to further investigate, can you please send us the .aip (project file) and a "verbose log" of the installation by e-mail at support at advancedinstaller dot com so we can investigate its settings?

Regards,
Catalin
this code work

USE [master]
GO
ALTER DATABASE [dbName] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
USE [master]
GO
DROP DATABASE [dbNamd]
GO
Catalin
Posts: 6597
Joined: Wed Jun 13, 2018 7:49 am

Re: drop sql database after uninstall

Hello,

I am glad you got this working!

Regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”