I wanted to add info to this.  I am using wix 2.0.4820.0.   I also tried
having the script be:
CREATE TABLE [AccountSubmission].[dbo].[MYNEWTABLE](
[col1][int],
[col2][int]
)
GO

it also didn't seem to execute.


Nikkoli wrote:
> 
> I am pulling my hair out with this problem.  Hopefully someone can point
> out what I am doing wrong.  My goal is to have the installer run a script
> to backup all the databases on the server, install some programs, then run
> scripts to update the database (structure and layout).  There is data in
> these databases that cannot be lost so simply dropping the databse is not
> an option.  
> 
> I can get the installer to correctly install the programs and alter their
> config files, and I think i can update the database afterwards, but I am
> surely stuck on the backup.  here is my sample code:
> 
> <--<?xml version="1.0" encoding="utf-8" ?>
> 
>   <Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi";>
>     <Product UpgradeCode="7aa0bcca-14f8-46c7-8e9d-6a9e523252c1"
> Name="MyTestSQL" Id="9b5cb943-e741-4fed-b284-6d2d69f578e1" Version="1.1.0"
> Manufacturer="xxx" Language="1033">
> 
>       <Package Id="c74f467e-5686-4202-8c54-7ebf83d59c21"
> Manufacturer="xxx" InstallerVersion="200" Platforms="Intel"
> Languages="1033" Compressed="yes" SummaryCodepage="1252" />
> 
>       <SqlDatabase Id="MySqlDatabase" Database="master" Server="(Local)"
> />
> 
>       <Directory Id="TARGETDIR" Name="SourceDir">
> 
>         <Component Id="MySqlComponent"
> Guid="C50999A0-02FD-42d5-9F65-7375318DD328" DiskId="1">
> 
>           <SqlScript Id="CreateDatabaseScript"
> BinaryKey="DatabaseScriptBin" ExecuteOnInstall="yes" SqlDb="MySqlDatabase"
> />
> 
>         </Component>
> 
>       </Directory>
> 
>       <Feature Id="DefaultFeature" Level="1">
> 
>         <ComponentRef Id="MySqlComponent" />
> 
>       </Feature>
> 
>       <Media Id="1" EmbedCab="yes" Cabinet="setup1.cab" />
> 
> 
>       <Binary Id="DatabaseScriptBin" src="c:\sqlbak2.sql" />
> 
>       <CustomAction Id='ConfigureSql' BinaryKey='ScaSchedule'
> DllEntry='ConfigureSql' Execute='immediate'
>                     Return='check'/>
> 
>       <Binary Id='ScaSchedule' src='scasched.dll'/>
> 
>     </Product>
>   </Wix> -->
> 
> the script I am trying to run contains:
> 
> BACKUP DATABASE AccountSubmission TO DISK =
> 'c:\DBBACKUPS\AccountSubmission.dat.bak'
> GO
> 
> repeated for each database.  When I run the installer, it never seems to
> execute the script.  Please help!!!
> 
> 

-- 
View this message in context: 
http://www.nabble.com/SQL-Backup-Script-in-WiX-tf3677232.html#a10285367
Sent from the wix-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to