Skip to main content
Answer

Error creating index on temporal table when including a column

  • April 17, 2025
  • 2 replies
  • 42 views

Forum|alt.badge.img

I have created a table with system versioning turned on. When I try to create an index on the _history table, and Include a column, a create script is generated with an empty include argument: 

create nonclustered index "some_name"
on "some_table_history"
(
"some_table_id",
"some_other_column"
)
include
(
)

Naturally, this gives an error on execution.

Doing the same on the base table gives a correct create script:

create nonclustered index "some_name"
on "some_table"
(
"some_table_id",
"some_other_column"
)
include
(
"some_third_column"
)

Why is an included column not included in the create script?

Best answer by Mark Jongeling

Hi Wouter,

When I inspect the underlying code that generates this for you, it seems we missed to list the Non-clustered (history table) index type in the listing of included index columns. I'm afraid I do not have a model-workaround at the moment for you. You could opt to manually create the index for the time being.

Could you create a ticket for this in TCP for the Software Factory? Thanks!

This topic has been closed for replies.

2 replies

Mark Jongeling
Administrator
Forum|alt.badge.img+23
  • Administrator
  • Answer
  • April 17, 2025

Hi Wouter,

When I inspect the underlying code that generates this for you, it seems we missed to list the Non-clustered (history table) index type in the listing of included index columns. I'm afraid I do not have a model-workaround at the moment for you. You could opt to manually create the index for the time being.

Could you create a ticket for this in TCP for the Software Factory? Thanks!


Forum|alt.badge.img
  • Author
  • Rookie
  • April 17, 2025

Hi Mark,

Thanks for your response.

Ticket is created: 11533S