Class MSSQLViewComparator

java.lang.Object
liquibase.diff.compare.core.MSSQLViewComparator
All Implemented Interfaces:
DatabaseObjectComparator

public class MSSQLViewComparator extends Object implements DatabaseObjectComparator
MSSQL-specific comparator for View objects that normalizes view definitions before comparison to prevent false diffs caused by inconsistent schema qualification across MSSQL server versions.

MSSQL's OBJECT_DEFINITION() returns different formats depending on server version:

  • Some versions: CREATE VIEW [dbo].[view_demo] WITH SCHEMABINDING AS ...
  • Other versions: CREATE VIEW view_demo WITH SCHEMABINDING AS ...

This comparator strips the optional [schema]. prefix and bracket quoting from the CREATE VIEW header only for comparison purposes, leaving the original definition on the snapshot object intact for changelog generation.