Yes. The easy way is to inline them as sql:SqlString elements. You can then embed properties in them which allow you to dynamically change the SQL run. If inlining them is an issue, you could have a template SQL file with substitution tags in it, apply a custom action to make the substitutions, and then another custom action to run it.
We use SqlString elements with embedded formatted properties in stored procedures and short hunks of SQL to stick special values into tables (primarily for farm awareness) or set up SQL permissions. -- John Merryweather Cooper Build & Install Engineer -- ESA Jack Henry & Associates, Inc.® Shawnee Mission, KS 66227 Office: 913-341-3434 x791011 [email protected] www.jackhenry.com -----Original Message----- From: Arunkumar Parvathy (Consultant) [mailto:[email protected]] Sent: Wednesday, August 28, 2013 5:18 AM To: [email protected] Subject: [WiX-users] Can we dynamically modify .sql files at install time Hi, Am new to WiX, so excuse if my question is too naïve. We use WiX to create msi for our product that will be installed in multiple sites. The product assumes a different behaviour for each site. We achieve this by means of WiX Transforms. I know that by using Wix, we can dynamically modify xml based files(configuration files for eg) at installation time. The question : Is there any way to dynamically modify .sql files at install time, which too are part of the installed package? For eg: have a variable in the .sql file which can capture some value entered through UI . Another question, Is there any way to combine the contents of multiple .sql files into a single .sql file during install time? Reason behind the question: We do not want Wix to run sql scripts on the DB while installing . Just collate the modified script files in a folder under the Install Dir, which the Installation team will later on run on the respective DB. Thanks in advance, PA ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk _______________________________________________ WiX-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wix-users NOTICE: This electronic mail message and any files transmitted with it are intended exclusively for the individual or entity to which it is addressed. The message, together with any attachment, may contain confidential and/or privileged information. Any unauthorized review, use, printing, saving, copying, disclosure or distribution is strictly prohibited. If you have received this message in error, please immediately advise the sender by reply email and delete all copies. ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk _______________________________________________ WiX-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wix-users

