Sample XML Files etc.

SBSB Posts: 3
edited February 12, 2008 4:10AM in SQL Packager Previous Versions
Hello,

I am looking for sample XML files to be used with SQL Packager CLI. Essentially, here is what I am planning to do.

- Compare schema between two databases and generate script
- Compare data between two databases and generate script
- Exclude certain tables when comparing Data (e.g. System Tables etc)
- Create an EXE to apply the changes as needed.
- Create a Script File that will list all of the changes that EXE will apply.

I am plannning to automate this so that our nightly builds can pickup the .EXE and merge them in our process as needed. Script file will be used for documentation only.

Thank you.

Comments

  • Hello,

    This shouldn't be a problem. The following example shows some options you can use with the XML command file to sqlpackager.exe. To create the package, you run sqlpackager.exe /argfile:<name of XML command file>
    &lt;?xml version="1.0"?&gt;
    &lt;commandline&gt;
    	&lt;!-- connection properties--&gt;
    	&lt;server1&gt;MyComputer\MyServer&lt;/server1&gt;
    	&lt;database1&gt;WidgetDev&lt;/database1&gt;
    	&lt;username1&gt;sa&lt;/username1&gt;
    	&lt;password1&gt;p@ssw0rd&lt;/password1&gt;
    	&lt;server2&gt;MyComputer\MyServer2&lt;/server2&gt;
    	&lt;database2&gt;WidgetLive&lt;/database2&gt;
    	&lt;username2&gt;sa&lt;/username2&gt;
    	&lt;password2&gt;P@ssw0rd&lt;/password2&gt;
    	&lt;!--System tables are ignored anyway...--&gt;
    	&lt;excludeschema&gt;\&#91;dbo\&#93;.\&#91;WidgetPrices\&#93;&lt;/excludeschema&gt;
    	&lt;excludedata&gt;table:\&#91;dbo\&#93;.\&#91;WidgetDescriptions\&#93;&lt;/excludedata&gt;
    	&lt;excludedata&gt;table:\&#91;dbo\&#93;.\&#91;WidgetPrices\&#93;&lt;/excludedata&gt;
    	&lt;!-- Output the schema and data scripts--&gt;
    	&lt;schemascript&gt;c:\temp\schema.sql&lt;/schemascript&gt;
    	&lt;datascript&gt;c:\temp\datascript.sql&lt;/datascript&gt;
    	&lt;!-- build options --&gt;
    	&lt;makeexe /&gt;
                    &lt;force /&gt;
    	&lt;location&gt;c:\temp&lt;/location&gt;
    	&lt;name&gt;MyPackage&lt;/name&gt;
    &lt;/commandline&gt;
    
  • Thank you Brian. I will try it out and post back if I have any questions.

    BTW: Where can I get a list of options? I didn't see them in the help file for CLI.

    Thanks.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi,

    The help is pretty minimal for the command-line. You'll get the full list of options from SQL Packager itself:
    sqlpackager /? /verbose
    
Sign In or Register to comment.