# To exute a sql tag (or sql statement) without writing in databasechangelog?

**URL:** https://forum.liquibase.org/t/to-exute-a-sql-tag-or-sql-statement-without-writing-in-databasechangelog/330
**Category:** General Discussion
**Created:** [November 2, 2009, 12:56pm UTC](https://forum.liquibase.org/t/to-exute-a-sql-tag-or-sql-statement-without-writing-in-databasechangelog/330 "2009-11-02T12:56:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![fcojavibr](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@fcojavibr](https://forum.liquibase.org/u/fcojavibr)
#### Post date: [November 2, 2009, 12:56pm UTC](https://forum.liquibase.org/t/to-exute-a-sql-tag-or-sql-statement-without-writing-in-databasechangelog/330/1 "2009-11-02T12:56:00Z")

</div>

Is there any way to execute a sql tag (or sql statement) by liquibase without writing a row in the databasechangelog table?

My situation is the next:  
I want to execute, more than once, a sql file with the same Author, same ID and same FileName. Sometimes the file is unchanged so I put runAlways=“true” in changeSet Tag. Other times the file is changed so a liquibase.exception.ValidationFailedException is launched to the user. To force the execution of the file in validationFailedException case, a user variable is used. If this variable is true, a liquibase xml is exuted previously:

\<?xml version="1.0" encoding="UTF-8"?\> http://www.liquibase.org/xml/ns/dbchangelog/1.9" &nbsp; xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance"](http://www.w3.org/2001/XMLSchema-instance%22) xsi:schemaLocation="[http://www.liquibase.org/xml/ns/dbchangelog/1.9&nbsp;](http://www.liquibase.org/xml/ns/dbchangelog/1.9%C2%A0) &nbsp; &nbsp; &nbsp; [http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd"\>](http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd%22>) &nbsp; &nbsp; &nbsp; update DATABASECHANGELOG SET MD5SUM=NULL WHERE AUTHOR='${author.name}'&nbsp; AND ID='${id.change}'; &nbsp; &nbsp; &nbsp; 

But I want to execute the tag that updates the md5sum to null using Liquibase without it writing a row (${Author-name}-Forcing md5Sum, ${id.change}, filename…) in the databasechangelog table.

---

<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: [November 2, 2009, 12:56pm UTC](https://forum.liquibase.org/t/to-exute-a-sql-tag-or-sql-statement-without-writing-in-databasechangelog/330/2 "2009-11-02T12:56:00Z")

</div>

There is a runOnChange=“true” attribute that you can use.&nbsp; If you specify it on a changeSet, it will execute that change every time the checksum is different than what is stored in the database.&nbsp;

You can use it along with the runAlways and have a changeSet always run and not complain if there is a checksum failure.&nbsp; You may be able to use it on the changeSets that do change and avoid the work-around you are doing.

Does that help?

Nathan

---

<div class="post-metadata">

### Author: ![fcojavibr](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@fcojavibr](https://forum.liquibase.org/u/fcojavibr)
#### Post date: [November 2, 2009, 12:56pm UTC](https://forum.liquibase.org/t/to-exute-a-sql-tag-or-sql-statement-without-writing-in-databasechangelog/330/3 "2009-11-02T12:56:00Z")

</div>

I know about this changeSet property, but I has asked for two reasons:  
 - To introduce a possibility in liquibase to execute sql / sql file / refactoring tags with zero-change in databasechangelog. I think it is not possible at the moment because it is always necessary to put author and id with no null values.

- Because I am lazy and I want to do this with the minimum code changes :P!

But if you say that it works with runAlways=“true”, and if user wants to force updated with runOnChange=“true” at the same time, I think it is a minimum change.

Many thanks!!
