SQL 2005 Express Edition - Installing a New Instance

Looking for a way to programmatically or otherwise add a new instance of SQL 2005 Express Edition to the system on which the instance is already installed. Traditionally, you run the Micrsoft installer, as I did on the command line below, and this does the trick. Running the command in my installer is not a problem, it is more about dragging and dropping about 40 MB of the MS-SQL installer, which I do not need if they already have SQL Express installed. This is what my installer does:

SQLEXPR32.EXE /qb ADDLOCAL=ALL INSTANCENAME=<instancename> SECURITYMODE=SQL SAPWD=<password> SQLAUTOSTART=1 DISABLENETWORKPROTOCOLS=0 

I don't need help running this command, but rather a suitable way to add a new instance of SQL 2005 Express without restarting the full installer.

I would like to talk in detail about why I want to do this, but I’ll just bore everyone. Suffice it to say that the ability to create a new instance without the time required to reinstall SQL Express, etc., would help me a lot in deploying my application and its installer. If it matters to everyone, I use a combination of NSIS and Advanced Installer for this installation project.

+6
command-line install instance sql-server-express sql-server-2005-express
source share
3 answers

After several months / years of studying this issue, this is not possible. Well, I think I just reinstall every time I want a new instance. I think this is because each instance is its own service.

0
source share

It looks like a custom instance might help you. If you have MDF and LDF files, you can connect to the files by specifying SQL Server Express to start the user instance and attach the specified file to this instance.

This artile http://msdn.microsoft.com/en-us/library/bb264564.aspx contains a good description of how you can build on an existing installation of SQL Server Express to create a custom instance instance for the duration of your connection.

Hope this helps.

+1
source share

I do not know how to do this with the API, but if no one gives a better solution, you can always use Process.Start () to execute your command line as is.

0
source share

All Articles