[wix-users] SQL database (sql:SqlDatabase)

Carlos Sosa carlos.sosa.us at outlook.com
Wed Sep 13 15:30:09 PDT 2017

Yes, the CreateTable file is available via :
<Binary Id='CreateTable' SourceFile='CreateTable.sql' />

When I installed the SQL I used this:


When I connect to my SQL using Management Studio  I select:
ServerType: Database Engine
ServerName: MachineName\InstanceName
Authentication: Windows Authentication
User: MachineName\Administrator (Greyed out)
Password (AdministratorPassword) (Greyed out)

The above settings allows me to connect to the server just fine.
So when I tried using the component, I assumed that in this line:
<util:User Id="SQLUser" Name="TEST\Administrator" Password="MXXX1XXXX" CreateUser="no" />
Name = MachineName\Administrator
Password = AdministratorPassword
I seen examples where this is set to:
<util:User Id='SQLUser' Name='[SQLUSER]' Password='[SQLPASSWORD]' />
But I assume that I can replace the [] with actual values, no?

The rest of the code, if I understand correctly, is going to try to create a database called 'Foobar' connecting using the credentials specified above
Is the Server value not defined correctly? Should I use "LocalHost" or MachineName\MyInstance? I'm pretty sure I tried every combination I could think of with no luck.
            <sql:SqlDatabase Id='SqlDatabase' Database='Foobar' User='SQLUser' Server=".\sqlexpress" Instance="MyInstance"
              CreateOnInstall="yes" DropOnUninstall="yes" ContinueOnError="yes">
And then run the script to create a table, etc.
              <sql:SqlScript Id="CreateTable" BinaryKey="CreateTable" ExecuteOnInstall="yes" />

Any help is appreciated.

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Joseph L. Casale via wix-users
Sent: Wednesday, September 13, 2017 3:42 PM
To: 'WiX Toolset Users Mailing List' <wix-users at lists.wixtoolset.org>
Cc: Joseph L. Casale <jcasale at activenetwerx.com>
Subject: Re: [wix-users] SQL database (sql:SqlDatabase)

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Carlos Sosa via wix-users
Sent: Wednesday, September 13, 2017 3:19 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Carlos Sosa <carlos.sosa.us at outlook.com>
Subject: [wix-users] SQL database (sql:SqlDatabase)

> In the logs I get: CreateDatabase:  Error 0x80004005: failed to create 
> SQL database but continuing, But ican't figure out why, any ideas?

Is the CreateTable file available? Might be my first guess based on that error code. Also, I see you are using Windows Auth, is it enabled and configured the way you expect?


WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

More information about the wix-users mailing list