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

Attachinng SQL Database

I want to know the steps on how to include my sql database MDF file in my setup package and prepare to attach to the sql server express 2005 (will also be included) all during the installation?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Attachinng SQL Database

Hello,

The steps should follow in this order:
- set SQL Server Express 2005 as a prerequisite for your package
- install the .mdf to the proper location by creating the appropriate structure from the Files and Folders Page. According to the Microsoft forums, the usual location is:
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\. However note that your user might select a different install location for your prerequisite, so you should use a Search to determine the location of SQL Server.
- consult the documentation on how to attach the database. Maybe this article on how to move sql server databases will help.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
jrahma
Posts: 51
Joined: Wed Jan 07, 2009 11:56 am

Re: Attachinng SQL Database

regarding the last point, am i going to attach the database during the installation or you mean in my application?

if during the installation, how?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Attachinng SQL Database

Hello,

You will need to do this during installation by using SQL Scripts. This can only be achieved in an Enterprise Project.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
jrahma
Posts: 51
Joined: Wed Jan 07, 2009 11:56 am

Re: Attachinng SQL Database

but I don't have the Enterprise!!

then any workaround?

what if i want to place into the default Data folder of c:\Program Files\Microsoft SQL Server? how can I determine what's the default path using the installer, copy the MDF filles there then using sqlcmd commandline to attach?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Attachinng SQL Database

Hi,
but I don't have the Enterprise!!
then any workaround?
You can try using the sqlcmd utility through a custom action. To find it on the target machine you can use a search.
what if i want to place into the default Data folder of c:\Program Files\Microsoft SQL Server?
You can try using a search to find the path you want. After that you can use a Property set with Formatted custom action to set APPDIR (the property which corresponds to "Application Folder") to the result of the search.

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

Return to “Feature Requests”