Friday, February 24, 2012

Installing SQL 2005 Express and attaching database from CD

Hi there,

I have created an .iss file which when compiled creates a setup.exe file on a cd rom. Within the .iss I have extracted the sqlexpress files out so that it will install straight from disk to the users machine rather than from the .msi file. All this has been successful so far....

My problem is:- I want to attach a database to the an instance of sqlexpress on the users machine. I have detached it from SQL Server 2000 and copied it over to the cd. The setup file copies these over the users hard drive. I have looked through many forums etc and the words that keep popping up are:-

sqlcmd.exe

template.ini

type into the command prompt.

Sorry if I'm a little ignorant but I am not sure how to go about these. How do I open the command prompt on the users machine from CD? Do I have to create something to do this?

Any information would be appreciated, any guidance or scripts would be great.

Regards

Sam

That depends how you do your copy job to copy the database to the folder. If you just copy it over you can just append another line with using the SQLCMD -Q"sp_attachdb ..... using the path to you already copied the file of the database to.

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Thank you for your reply.

I'm still a little unsure of what you mean. Do you mean to add a new line of code within my .iss file.

I have detached my database from my machine using SQL Server 2000 and I want to attach it to the users machine from CD.

Here is a sample of the code within my .iss file.

[Files]
Source: "D:\dotnetfx.exe"; Flags: dontcopy
Source: "D:\WEB\WCU\SSE\SQLEXPR.EXE"; Flags: dontcopy
Source: "D:\UltiDevCassiniWebServer2.exe"; Flags: dontcopy
Source: "D:\CA\*"; DestDir: "C:\CA\"; Flags: ignoreversion recursesubdirs createallsubdirs ' aspx files

Source: "D:\CA.mdf"; DestDir: "C:\CA\"; Flags: ignoreversion recursesubdirs createallsubdirs ' detached database
Source: "D:\c_icons.ico"; DestDir: "C:\CA\"; Flags: ignoreversion
Source: "D:\CA.url"; DestDir: "{userdesktop}"; Flags: ignoreversion

; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Run]
Filename: "D:\WEB\WCU\SSE\SQLEXPR.EXE"; StatusMsg: "Installing SQL Server 2005 Express Edition..."; Flags: skipifdoesntexist;
Filename: "D:\UltiDevCassiniWebServer2.exe"; StatusMsg: "Installing UltiDev Cassini Web Server 2.0..."; Flags: skipifdoesntexist;

thanks

Sam

No comments:

Post a Comment