# IDENTITY\_INSERT is set to OFF

**URL:** <https://forum.liquibase.org/t/identity-insert-is-set-to-off/8549>\
**Category:** General Discussion\
**Created:** [August 17, 2023, 2:20pm UTC](https://forum.liquibase.org/t/identity-insert-is-set-to-off/8549 "2023-08-17T14:20:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sohan.badaya](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sohan.badaya](https://forum.liquibase.org/u/sohan.badaya)\
**Post date:** [August 17, 2023, 2:20pm UTC](https://forum.liquibase.org/t/identity-insert-is-set-to-off/8549/1 "2023-08-17T14:20:46Z")

</div>

Hi Team,

I am using Liquibase tool for database migration from one database(MSSQL) to other database(MSSQL). I am able to generate change xml file using **generateChangeLog** command which has create and insert queries. so far its good.

Now when I try to execute update command then it fails with below reason: liquibase.exception.DatabaseException: Cannot insert explicit value for identity column in table ‘TableName’ when IDENTITY\_INSERT is set to OFF.

It works fine if I manually add below tag in change xml file,  
  
SET IDENTITY\_INSERT HOSTGROUP ON;  
  
Insert queries here…  
  
SET IDENTITY\_INSERT HOSTGROUP OFF;  
  
But I am looking for automated way.

_Is there any option in generateChangeLog command to add above tag automatically?_ Please help.
