# SQL format changelog

**URL:** <https://forum.liquibase.org/t/sql-format-changelog/2301>\
**Category:** General Discussion\
**Created:** [June 14, 2013, 7:03pm UTC](https://forum.liquibase.org/t/sql-format-changelog/2301 "2013-06-14T19:03:00Z")\
**Posts on this page:** 5\
**Page:** 1

<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 14, 2013, 7:03pm UTC](https://forum.liquibase.org/t/sql-format-changelog/2301/1 "2013-06-14T19:03:00Z")

</div>

It is working correctly for me. Can you post your sql file and how you are calling it?  
  
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 14, 2013, 7:03pm UTC](https://forum.liquibase.org/t/sql-format-changelog/2301/2 "2013-06-14T19:03:00Z")

</div>

With formatted sql style changelogs you can use the sql style directly without needing a containing XML file. The changeset metadata is in the – comments.

I think I see where the problem is, there is two ways liquibase will try to parse the sql, one as formatted sql and one assuming it is just regular SQL.

The formatted sql parser expects the file to start with&nbsp;Also, I tried your example locally with 3.0 and it worked fine for me, could you try upgrading and see if that works better?  
  
Nathan

---

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forum.liquibase.org/u/Guest)\
**Post date:** [June 14, 2013, 7:03pm UTC](https://forum.liquibase.org/t/sql-format-changelog/2301/3 "2013-06-14T19:03:00Z")

</div>

Hi there, I’m having difficulty in getting the&nbsp;ID and&nbsp;AUTHOR fields to populate correctly in the DATABASECHANGELOG table.&nbsp;

&nbsp;

If I use an xml file for my changelog&nbsp;the update works fine (\<changeSet id=“1” author=“testuser”\>) but I want to use a SQL file (–changeset testuser:1) which results in&nbsp;ID being set to raw and&nbsp;AUTHOR set to includeAll.

&nbsp;

Help!

---

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forum.liquibase.org/u/Guest)\
**Post date:** [June 14, 2013, 7:03pm UTC](https://forum.liquibase.org/t/sql-format-changelog/2301/4 "2013-06-14T19:03:00Z")

</div>

Here are the contents of my sql file:

1. –liquibase formatted sql  
–changeset testuser:1  
create table test1 (  
&nbsp;&nbsp;&nbsp; id int primary key,  
&nbsp;&nbsp;&nbsp; name varchar(255)  
);  

I’m calling it from the command line with the following:

1. java -jar liquibase.jar --driver=com.microsoft.sqlserver.jdbc.SQLServerDriver --classpath=sqljdbc4.jar --changeLogFile=ods\_changelog\_sql.sql --url=“jdbc:sqlserver://tl-test5\SQLEXPRESS:1433;DatabaseName=Liquibase\_Eval” --username=sa --password=ibuser update

&nbsp;

It’s Liquibase version 2.0.5.

&nbsp;

Thanks for taking the time to look at this.

---

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forum.liquibase.org/u/Guest)\
**Post date:** [June 14, 2013, 7:03pm UTC](https://forum.liquibase.org/t/sql-format-changelog/2301/5 "2013-06-14T19:03:00Z")

</div>

Don’t you must create a changelog that call the SQL changeset instead of calling directly the changeset ?
