Details

    • Complexity:
      Medium

      Description

      Since there are IDENTITY columns in many tables, SQL Server prevents manual entry of ids into such columns. SQL Server provides SET IDENTITY_INSERT <tableName> ON for allowing inserting ids. Thus all insert statements done through liquibase needs to be checked and wrapped between:

      SET IDENTITY_INSERT <tableName> ON;
      insert...;
      SET IDENTITY_INSERT <tableName> OFF;
      

      Care should be taken to first check if there is an identity column in the table or else the SET IDENTITY_INSERT fails with exception.
      This can be implemented through extensions in liquibase 2.0

        Gliffy Diagrams

          Attachments

            Attachments-Category-Modification

              Activity

                People

                • Assignee:
                  sunbiz Saptarshi Purkayastha
                  Reporter:
                  sunbiz Saptarshi Purkayastha
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: