attach a database while installing - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

jrahma
Posts: 51
Joined: Wed Jan 07, 2009 11:56 am

attach a database while installing

I am creating a new package which should install the SQL Server 2005 and I want to attach a database at the same time?

How can I do that?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: attach a database while installing

Hi,

In order to install SQL Server you can try using a prerequisite. Please note that Advanced Installer has predefined prerequisites for SQL Server 2005. For attaching a database you can use a SQL script. The User Guide contains a SQL script tutorial which may help you.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jrahma
Posts: 51
Joined: Wed Jan 07, 2009 11:56 am

Re: attach a database while installing

but how can I attach the mdf to use in the command line script?

Should I include in the EXE package or it should be separated?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: attach a database while installing

Hi,

Please note that only SQL Server should be added as a prerequisite. For attaching the database you can use an SQL script. The database file (MDF) can be installed by the package and an SQL script can attach it.

Another approach would be to use sqlcmd.exe as a custom action. After the database file is installed you can run a custom action to attach it. Perhaps this thread will help you:
http://www.advancedinstaller.com/forums ... 95&p=18677

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”