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

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  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  --password=pwd migrate

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

thanks,

wantime

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

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.

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

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

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

That should be right.  Are you using liquibase 1.9.5?

Nathan