I am using 2.0.5280. The scripts don't work and I get some weird error
messages. The reason that I think Wix is do some substituitions is I see
lines like:
ExecuteSqlStrings: Error 0x80040e14: failed to execute SQL string, error:
Invalid column name 'MerchantStatus'., SQL key:
CreateTransactionsStoredProcedures SQL string: IF EXISTS (SELECT * FROM
sys.objects WHERE object_id = OBJECT_ID(N'.') AND type in (N'P', N'PC'))
DROP PROCEDURE .
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'.')
AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'--
=============================================
-- Author: <Kevin Burton,,>
-- Create date: <4/17/2007,,>
-- Description: <Get orders based on order source id and merchant status,,>
-- =============================================
CREATE PROCEDURE .
@OrderSourceId nvarchar(50)
AS
BEGIN
SET NOCOUNT ON;
SELECT OrderGroupId,,
FROM OrderForms
WHERE OrderSourceID = @OrderSourceId AND ( != OR is null)
END
'
In the installation log. It seems that <SqlScript> calls the same functions
as <SqlString> to process the input. My Wix source looks like:
<SqlScript Id='CreateBuySeasonsStoredProcedures' SqlDb="BuySeasons"
ExecuteOnInstall='yes'>
<Binary Id='CreateBuySeasonsStoredProcedures'
SourceFile='BuySeasonsStoredProcedures.sql' />
</SqlScript>
The script should look like:
SELECT OrderGroupId,[MerchantStatusSent],[MerchantStatus]
FROM OrderForms
WHERE OrderSourceID = @OrderSourceId AND ([MerchantStatusSent] !=
[MerchantStatus] OR [MerchantStatusSent] is null)
END
'
END
Is this not right?
Kevin
From: Mike Dimmick [mailto:[EMAIL PROTECTED]
Sent: Sunday, May 06, 2007 12:53 PM
To: 'Kevin Burton'; wix-users@lists.sourceforge.net
Subject: RE: [WiX-users] <SqlScript> and escape sequences.
What version of WiX are you using? I'm looking at the CA code for SqlScript
for both current releases (2.0.5213.0, 3.0.2813.0) and can't see where it
replaces properties in the script. The function ScaSqlStrsReadScripts in
scasqlstr.cpp (src\ca\serverca\scasched) does a lot of manipulation to
remove comments and split the script at GO commands, but doesn't appear to
either process [] or to call MsiFormatRecord.
You're correct that SqlString substitutes properties: it uses
WcaGetRecordFormattedString to retrieve the SQL text, which performs the
format processing (substituting properties, etc).
You can also use "" to delimit identifiers in SQL, as long as the
QUOTED_IDENTIFIER option is set to ON, which it is by default when using OLE
DB (which WiX uses to talk to SQL Server). However, when dumping a script
using Enterprise Manager, each stored procedure is surrounded by SET
statements indicating how the option was set when the stored procedure was
created, so you may need to remove these statements if they set
QUOTED_IDENTIFIER to OFF.
--
Mike Dimmick
_____
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kevin Burton
Sent: 06 May 2007 01:12
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] <SqlScript> and escape sequences.
I have a <SqlScript> task in my Wix file (.wxs) and as best as I can tell it
treats all of the [xxx] as properties so the SQL script does not run. Does
anyone have a solution on how I can run a valid SQL script with WIX? Ideally
I would like Wix to send the stream as is to the SQL engine and execute it
without trying to interpret each line and trying to substitute properties. I
can see <SqlString> substituting but when it comes to the file I don't see
the usefulness. Anyway, is there another task that I can use to escape all
of the required characters in the file before sending it to <SqlScript>?
Kevin
-------------------------------------------------------------------------
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