# MSSQL 2005: how to generate sql Script DIRECT from changelog.xml

**URL:** <https://forum.liquibase.org/t/mssql-2005-how-to-generate-sql-script-direct-from-changelog-xml/538>\
**Category:** General Discussion\
**Created:** [June 7, 2010, 12:24pm UTC](https://forum.liquibase.org/t/mssql-2005-how-to-generate-sql-script-direct-from-changelog-xml/538 "2010-06-07T12:24:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wantime](https://avatars.discourse-cdn.com/v4/letter/w/dc4da7/32.png) [@wantime](https://forum.liquibase.org/u/wantime)\
**Post date:** [June 7, 2010, 12:24pm UTC](https://forum.liquibase.org/t/mssql-2005-how-to-generate-sql-script-direct-from-changelog-xml/538/1 "2010-06-07T12:24:00Z")

</div>

hi all,

just like the Subject mentioned, i would like to know if there are any magic to generate sql Script direct from changelog.xml?

that’s say, i write a changelog.xml, and i want to generate a mssql Script from this changelog.xml by using some command or tools. In alike way it should also be possible to generate a mysql Script or Oracal Script from this changelog.xml. Are there any method to do this?

i usually generate sql from changelog.xml in 2 Steps, but now i would like to find a more effective way to do it. any tips or articels are &nbsp;appreciated.

step 1: generate a MSSQL DB “test2” by using changelog.xml

liquibase --changeLogFile=C:/liquibase/liquibase-1.9.5/test2/changelog.xml --driver=com.microsoft.sqlserver.jdbc.SQLServerDriver --url="jdbc:sqlserver://localhost:1433;DatabaseName=test2" --classpath="C:/xxx/sqljdbc4.jar" --username=us &nbsp;--password=pwd migrate

step 2: export sql Script from DB “test2” by using SQL Server Management Studio.

thanks,

wantime

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [June 7, 2010, 12:24pm UTC](https://forum.liquibase.org/t/mssql-2005-how-to-generate-sql-script-direct-from-changelog-xml/538/2 "2010-06-07T12:24:00Z")

</div>

There is an updateSQL command you can use instead of migrate which will output the SQL that would have ran to stdout without touching the database.

Nathan

---

<div class="post-metadata">

**Author:** ![chandramohan\_mani](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@chandramohan\_mani](https://forum.liquibase.org/u/chandramohan_mani)\
**Post date:** [June 7, 2010, 12:24pm UTC](https://forum.liquibase.org/t/mssql-2005-how-to-generate-sql-script-direct-from-changelog-xml/538/3 "2010-06-07T12:24:00Z")

</div>

I dont see any difference running UpdateSQL & Update command.  
I am using mvn to do this, but when I run updateSQL it did touch the database, ran migrations and then generated sql. I am I making any mistake.

below is my mvn updatesql profile.

&nbsp; &nbsp; &nbsp; update-sql &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; com.mysql.jdbc.Driver &nbsp; &nbsp; &nbsp; &nbsp; jdbc:mysql://localhost:33062/test &nbsp; &nbsp; &nbsp; &nbsp; ... &nbsp; &nbsp; &nbsp; &nbsp; changelog.xml &nbsp; &nbsp; &nbsp; 

&nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; src/main/resources  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; src/sql  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; org.liquibase  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; liquibase-plugin  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; true  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; process-resources  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ${changeLogFile}  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; updateSQL  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp;

> _Originally posted by: Nathan_  
> There is an updateSQL command you can use instead of migrate which will output the SQL that would have ran to stdout without touching the database.
> 
> Nathan

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [June 7, 2010, 12:24pm UTC](https://forum.liquibase.org/t/mssql-2005-how-to-generate-sql-script-direct-from-changelog-xml/538/4 "2010-06-07T12:24:00Z")

</div>

That should be right.&nbsp; Are you using liquibase 1.9.5?

Nathan
