You didn't say which version. This description is for 3.0.3502.0, but you
should be able to find the source in other versions.

 

The ScaSqlStrsReadScripts function (in
src\ca\serverca\scasched\scasqlstr.cpp) strips out comments that precede a
statement batch (from the top of the file to the first statement, and from a
GO to the next statement). Comments within a function/procedure/etc should
be preserved.

 

I'm not sure why the prefix comments are stripped out - perhaps to help with
locating GO statements (while skipping the word 'go' within a comment) or
perhaps simply to save space in the deferred custom action data. Looking at
the implementation you could actually put a single-line comment using --
first (which would be removed), and follow that with a multi-line comment
using /* */ which would be preserved. (This is probably a bug and shouldn't
be relied on, though - a proper lexer, which could handle comments in any
order, would be appropriate.)

 

This function is called by the immediate custom action InstallSqlData, which
copies the script text (minus comments as above) into the CustomActionData
property for the ExecuteSqlStrings action. This deferred action actually
does the work calling SqlSessionExecuteQuery, which uses the SQL Server OLE
DB provider to pass the script text to the database server.

 

If you feel like implementing it yourself you'd probably need to extend the
attributes (so far only five bits are defined), and extend the schema and
the compiler. The SqlExtension source is in src\ext\SqlExtension\wixext, and
you'd need to modify Xsd\sql.xsd to add a new XML attribute, then
SqlCompiler.cs:ParseSqlScriptElement to process it.

 

If you don't fancy it, you can leave a suggestion in the Feature Requests
tracker on SourceForge at http://sourceforge.net/tracker/?group_id=105970
<http://sourceforge.net/tracker/?group_id=105970&atid=642717> &atid=642717.

 

-- 

Mike Dimmick

 

  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Quattro IV
Sent: 17 January 2008 18:31
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] SQLExtension -- RESEND

 

Hi again, I still haven't gotten an answer to this, anyone?

Hello, I believe there is a bug (from my perspective it's a bug anyway) in
the way that the SQLExtension deploys SQL scripts (specifically stored
procedures). The install functions correctly and even installs all of my
scripts, stored procedures, etc. However, the comments which are included in
the stored procedures get stripped out sometime during the installation. Is
there a way to preserve comments? 

Reese 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to