Installing SQL Express

For all your non-technical questions.
rdeberry
Posts: 24
Joined: Tue Jan 17, 2006 9:16 am
Location: Texas, USA

Postby rdeberry » Thu Jan 19, 2006 7:53 pm

I thought that MSSQL$SQLEXPRESS was the name of the service that it is checking for? Th first dialog has this under the service name entry which is also what I see as the service name under control panel. The default instance is SQLEXPRESS. If I name the instance, where do I enter the check for that name? In the service name text box?

So it would be MSSQL$MYINSTANCENAME under the services name?

CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Postby CandiceJones » Thu Jan 19, 2006 8:16 pm

I believe so. Just double-check the name of the SQL Express service as listed under the Control Panel -> Admin Tools -> Services applet to be sure. Note that you will need to double-click the displayed service name to obtain the actual service name in the services applet.
Candice Jones
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

Gizm0
Posts: 339
Joined: Wed Nov 09, 2005 8:47 pm

Postby Gizm0 » Thu Jan 19, 2006 9:08 pm

rdeberry wrote:I thought that MSSQL$SQLEXPRESS was the name of the service that it is checking for? Th first dialog has this under the service name entry which is also what I see as the service name under control panel. The default instance is SQLEXPRESS. If I name the instance, where do I enter the check for that name? In the service name text box?

So it would be MSSQL$MYINSTANCENAME under the services name?


Yes, exactly.If your instancename is DHS then the service name will be MSSQL$DHS..So you can check for it, and take neccessary actions..Note that if you want to use SSL to connect to the SQL Server, you need special libraries installed on your pc..It doesn't make sense to use SSL when installing the database..You should remove the SSL option, and only use it afterwards, when you connect to the database from your application, just for extra protection.As long as you just want to run a script to create a database or a login, from your IA setup file, you shouldn't use SSL.
Panagiotis Kefalidis
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
InstallAware Software Corporation

rdeberry
Posts: 24
Joined: Tue Jan 17, 2006 9:16 am
Location: Texas, USA

Postby rdeberry » Fri Jan 20, 2006 8:18 am

Thanks Gizmo. I have it installing/checking by instance name now. I am not trying to use SSL, I do not know how that option is enabled/disabled.

I have tried executing the SQL script from the installer as the sa as well as leaving the user name/password blank( I assume that mean Windows Authentication). I do not see any errors now in the log files but the script never executes.

I installed the Management Studio and logged in as sa and then executed the script manually. The script added the login correctly. I then removed the login and executed the script using Windows Authentication and it worked as well. I must be missing something simple.

Do you have an example of executing a SQL script?

Gizm0
Posts: 339
Joined: Wed Nov 09, 2005 8:47 pm

Postby Gizm0 » Fri Jan 20, 2006 10:27 am

Ok here is a sample script:

Code: Select all

~InstallAware Clipboard Data~
~MS SQL Server~
~{BC3423AE-2401-464D-A486-7E97066AA508}~
~(local),testing,test_db,sa,sesame,,"if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Kladoi]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)$NEWLINE$drop table [dbo].[Kladoi]$NEWLINE$GO$NEWLINE$",-1,0~
~mMSSQLIDE.dll\\mMSSQLExec.dll~


Also, note that, after the installation of the SQL Server, you have TO START THE SERVICE before you execute the script, as the service is NOT running, thus you may get these errors you mention..
Panagiotis Kefalidis

Software Design Team Lead

\"In order to succeed, your desire for success should be greater than your fear of failure\"

InstallAware Software Corporation

rdeberry
Posts: 24
Joined: Tue Jan 17, 2006 9:16 am
Location: Texas, USA

Postby rdeberry » Fri Jan 20, 2006 11:11 am

Thanks Gizmo!!!!!

I had (local)\\Instancename. This was left over from when I had (local)\\SQLEXPRESS.

I have the login/createdb part working now. Now I am going to include the create tables and sprocs.

IF I load the script, it puts this "ÿþI". Is that normal?

Gizm0
Posts: 339
Joined: Wed Nov 09, 2005 8:47 pm

Postby Gizm0 » Fri Jan 20, 2006 11:22 am

rdeberry wrote:Thanks Gizmo!!!!!

I had (local)\\Instancename. This was left over from when I had (local)\\SQLEXPRESS.

I have the login/createdb part working now. Now I am going to include the create tables and sprocs.

IF I load the script, it puts this "ÿþI". Is that normal?


No i guess you're using an old version of IA or the format of the .sql file is UTF-8 and not ANSI.. it has to be ANSI to load it correctly.. if you can't load it that way, copy paste it..
Panagiotis Kefalidis

Software Design Team Lead

\"In order to succeed, your desire for success should be greater than your fear of failure\"

InstallAware Software Corporation

rdeberry
Posts: 24
Joined: Tue Jan 17, 2006 9:16 am
Location: Texas, USA

Postby rdeberry » Fri Jan 20, 2006 6:01 pm

Can I use variables in the SQL Script?

EXEC sp_attach_db @dbname = N'DHS_MAIN', @filename1 = N'I:\\Program Files\\Microsoft SQL Server\\MSSQL.1\\MSSQL\\Data\\DHS_MAIN_DATA.mdf', @filename2 = N'I:\\Program Files\\Microsoft SQL Server\\MSSQL.1\\MSSQL\\Data\\DHS_MAIN_log.ldf'

I want it to be this:

EXEC sp_attach_db @dbname = N'DHS_MAIN', @filename1 = N'$PROGRAMFILES$Microsoft SQL Server\\MSSQL.1\\MSSQL\\Data\\DHS_MAIN_DATA.mdf', @filename2 = N'$PROGRAMFILES$Microsoft SQL Server\\MSSQL.1\\MSSQL\\Data\\DHS_MAIN_log.ldf'

It says it executes, but nothing happens. If I hard code it, it works from installer.

CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Postby CandiceJones » Fri Jan 20, 2006 6:25 pm

Sure, you can use variables in the SQL script freely!
Candice Jones

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

jwkerley
Posts: 1
Joined: Wed Feb 15, 2006 11:32 am

Postby jwkerley » Wed Feb 15, 2006 2:01 pm

We have had a few problems attaching SQL databases too.

If you look in the Application event log you will see errors logged by SQL Server if the attach is being attempted but failing, which may give you some clue as to the problem.

When trying to attach with the log files, we get errors stating that the log file doesn't match the MDB.

When attaching without the log file (which would be our preferred method anyway), we have a permissions issue on one of our 2 databases we attach. The event log error from SQL stated that the MDB file didn't exist, which was clearly incorrect. Using Filemon it was apparent that the SQL service didn't have permissions to use the file, which tallies with what we see in Windows Explorer - no permissions set for it. Only confusion is that we have set permissions to Full Access for Everyone in InstallAware for the MDB, the same as the other MDB which works :roll:

Anyway, have a look in the Application event log...


Return to “Non-Technical”

Who is online

Users browsing this forum: No registered users and 29 guests