# Rollback-sql cannot contain 'changesetid' in the script

**URL:** <https://forum.liquibase.org/t/rollback-sql-cannot-contain-changesetid-in-the-script/9619>\
**Category:** General Discussion\
**Created:** [August 20, 2024, 3:29pm UTC](https://forum.liquibase.org/t/rollback-sql-cannot-contain-changesetid-in-the-script/9619 "2024-08-20T15:29:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsegura](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jsegura](https://forum.liquibase.org/u/jsegura)\
**Post date:** [August 20, 2024, 3:29pm UTC](https://forum.liquibase.org/t/rollback-sql-cannot-contain-changesetid-in-the-script/9619/1 "2024-08-20T15:29:58Z")

</div>

Hi,

I’m creating a SQL changeset file that that alters a view. This alteration adds an outer apply to the query in the following manner:

```auto
CREATE OR ALTER VIEW [dbo].[PurchaseOrderView] AS
SELECT
	Po.ID AS Id,
	Po.Number AS PoNumber,
	...
	CAST(CASE WHEN EXISTS(
		SELECT * FROM dbo.tblChangeAcc AS ca
		LEFT JOIN tblChange c ON c.Id = ca.ChangeId
		LEFT JOIN tblChangeSet cs ON cs.Id = c.ChangeSetId
		WHERE cs.Id = Po.ChangeSetId
	) THEN 1 ELSE 0 END AS BIT) AS IsModified,
	...
FROM PurchaseOrders AS Po
	...
	OUTER APPLY (
	select top 1 [UtcDate] lastChange, UserId, UserId
	FROM dbo.tblChange 
	WHERE (ChangeSetId = po.ChangeSetId)
	order by [UtcDate] desc
	) as Change
	...

GO

```

When running the `updateSql` command to just this update, Liquibase parses and logs the preview of the changes that are going to be perform correctly.  
However, when I add the following rollback code:

```auto
--rollback CREATE OR ALTER VIEW [dbo].[PurchaseOrderView] AS
--rollback SELECT
--rollback Po.ID AS Id,
--rollback Po.Number AS PoNumber,
--rollback ...
--rollback CAST(CASE WHEN EXISTS(
--rollback SELECT * FROM dbo.tblChangeAcc AS ca
--rollback LEFT JOIN tblChange c ON c.Id = ca.ChangeId
--rollback LEFT JOIN tblChangeSet cs ON cs.Id = c.ChangeSetId
--rollback WHERE cs.Id = Po.ChangeSetId
--rollback ) THEN 1 ELSE 0 END AS BIT) AS IsModified,
--rollback ...
--rollback FROM PurchaseOrders AS Po
--rollback ...
--rollback 
--rollback GO

```

The following error appears:

> ERROR: Exception Details  
> ERROR: Exception Primary Class: ChangeLogParseException  
> ERROR: Exception Primary Reason: ‘changesetId’ not set in rollback block

Looking at the documentation I found the parameter `--changelog-parse-mode`, that when changed to `LAX` “continues with the parsing when encountering unknown fields in changelog files”. But I’m not sure if this is the correct use for that parameter.

Is `changesetId` a reserved word in the rollback parsing? Is there an option or workaround to this issue?

---

<div class="post-metadata">

**Author:** ![daryldoak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/daryldoak/32/764_2.png) [@daryldoak](https://forum.liquibase.org/u/daryldoak)\
**Post date:** [August 20, 2024, 9:28pm UTC](https://forum.liquibase.org/t/rollback-sql-cannot-contain-changesetid-in-the-script/9619/2 "2024-08-20T21:28:40Z")

</div>

Please provide the entire changelog/changeset so we can see how this has been developed, and the entire liquibase command you are running.
