Thanks guys. That is right on the money to do with ANSI and UNICODE. I found this too FYI,
http://n2.nabble.com/Error-executing-sql-scripts-with-WIX-td1488703.html And the characters in that post were the same ones I had. But I remember now, the first time I created that script I used visual studio to create a text file for me. This time around I created a blank file using notepad and used that. Thanks, Peter. On Fri, Nov 28, 2008 at 2:22 PM, Joe Osman <[EMAIL PROTECTED]> wrote: > Hi Peter, > What happen if you use sqlcmd to run the script? Do you get the same error > ? > Joe > > Michael Osmond wrote: > > Peter, > > > > I am not sure of all the details, but try saving the SQL script as ANSI > > format. > > > > Michael > > > > -----Original Message----- > > From: Peter McClymont [mailto:[EMAIL PROTECTED] > > Sent: Friday, 28 November 2008 11:01 AM > > To: wix-users@lists.sourceforge.net > > Subject: [WiX-users] Running SQL scripts under WIX > > > > Hi All, > > > > I have a rather disturbing problem that I am having a lot of trouble > > figuring out. > > > > Our WIX installer is adding a database, and running a SQL script as it > > does the install. It looks like this, > > > > <Binary Id="CreateTableScript" > > SourceFile="$(var.iC3.TargetDir)\SQLScripts\CreateTables.sql" /> > > > > <Directory Id="TARGETDIR" Name="SourceDir" FileSource=".\"> > > <Directory Id="ProgramFilesFolder"> > > <Directory Id='Dir' Name="Company Name"> > > <Directory Id="INSTALLLOCATION" Name="Product Name" > > > <Component Id="MainDatabase" > > Guid="dd6f7b80-bcbb-11dd-ad8b-0800200c9a66"> > > <sql:SqlDatabase Id="MainDatabase" Database="Database" > > CreateOnInstall="yes" Instance="SQLExpress" Server="localhost" > > DropOnUninstall="yes" ContinueOnError="yes"> > > <sql:SqlScript Id="CreateDatabaseTables" > > BinaryKey="CreateTableScript" ContinueOnError="no" > > ExecuteOnInstall="yes"/> > > </sql:SqlDatabase> > > </Component> > > <Directory Id="ArchiveDirectory" Name="Archive" /> > > </Directory> > > </Directory> > > </Directory> > > > > And the SQL script looks like this (the first part anyway), > > > > SET ANSI_NULLS ON > > GO > > > > SET QUOTED_IDENTIFIER ON > > GO > > > > CREATE TABLE [dbo].[CollectedBatchStore]( > > [uid] [int] IDENTITY(1,1) NOT NULL, > > [CollectedBatchStoreName] [nvarchar](50) NOT NULL, > > [DataType] [smallint] NOT NULL, > > CONSTRAINT [PK_dbo.CollectedBatchStore] PRIMARY KEY CLUSTERED ( > > > > > > ETC ETC > > > > Anyway it all compiles properly, but when I run the installer it > > complains with an error message, > > > > Error -2147217900: failed to execute SQL string. Incorrect syntax near > > '>>' > > (this is a funny character which has 2 arrows in one character) > > > > I look at the SQL profiler to see what SQL it is running, and I see > > this, > > > > Drop database Database > > Create database Database > > exec i>>?SET ANSI_NULLS ON > > > > You see after the exec above there are a few funny characters, and it > > should be starting at the 'SET ANSI_NULL ON' part of that statement. I > > don't understand where the characters are coming from. > > > > Thanks, > > > > Peter. > > ------------------------------------------------------------------------ > > - > > This SF.Net email is sponsored by the Moblin Your Move Developer's > > challenge Build the coolest Linux based applications with Moblin SDK & > > win great prizes Grand prize is a trip for two to an Open Source event > > anywhere in the world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ > > WiX-users mailing list > > WiX-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wix-users > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > > Build the coolest Linux based applications with Moblin SDK & win great > prizes > > Grand prize is a trip for two to an Open Source event anywhere in the > world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ > > WiX-users mailing list > > WiX-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wix-users > > > > > > ======================================================================= > This email, including any attachments, is only for the intended > addressee. It is subject to copyright, is confidential and may be > the subject of legal or other privilege, none of which is waived or > lost by reason of this transmission. > If the receiver is not the intended addressee, please accept our > apologies, notify us by return, delete all copies and perform no > other act on the email. > Unfortunately, we cannot warrant that the email has not been > altered or corrupted during transmission. > ======================================================================= > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users