# SqlServer Index Challenge

**URL:** https://forum.liquibase.org/t/sqlserver-index-challenge/9280
**Category:** General Discussion
**Created:** [April 15, 2024, 1:22pm UTC](https://forum.liquibase.org/t/sqlserver-index-challenge/9280 "2024-04-15T13:22:12Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rayalexander](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rayalexander](https://forum.liquibase.org/u/rayalexander)
#### Post date: [April 15, 2024, 1:22pm UTC](https://forum.liquibase.org/t/sqlserver-index-challenge/9280/1 "2024-04-15T13:22:12Z")

</div>

I am using mssql 2017 and liquibase 4.26.0 and I’m having a challenge with non-clustered indexes.

A t-sql file i have contains this

```auto
CREATE NONCLUSTERED INDEX IX_TGroup_CRMContactId ON [dbo].[TGroup] ([CRMContactId]) INCLUDE ([GroupId])

```

I deploy the t-sql to a reference database using an includeAll and sqlcmd, which creates it correctly.

But when I **diff-changelog** between 2 databases the following changeset is produced, i.e. without the INCLUDE column.

```auto
- changeSet:
    id: 1713178532602-12
    author: ralexander
    changes:
    - createIndex:
        columns:
        - column:
            name: CRMContactId
        indexName: IX_TGroup_CRMContactId
        tableName: TGroup

```

Does anyone know how I can resolve this

---

<div class="post-metadata">

### Author: ![tedk](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@tedk](https://forum.liquibase.org/u/tedk)
#### Post date: [April 24, 2024, 10:46pm UTC](https://forum.liquibase.org/t/sqlserver-index-challenge/9280/2 "2024-04-24T22:46:53Z")

</div>

> [@rayalexander](#):
>
> lcmd, w

FYI, the " INCLUDE ([GroupId]) " part of the index definition is a TSQL dialect extension. So it can’t be coded with the createIndex tag.  
You can use the sql tag for example  
`

- changeSet:  
id: 1713178532602-12  
author: ralexander  
changes:
  - sql:  
dbms: ‘mssql’  
endDelimiter: \nGO  
splitStatements: true  
sql: CREATE NONCLUSTERED INDEX IX\_TGroup\_CRMContactId ON [dbo].[TGroup] ([CRMContactId]) INCLUDE ([GroupId])  
stripComments: true  
` `
