Skip to main content
Solved

Error creating index on temporal table when including a column


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!

View original
Did this topic help you find an answer to your question?

2 replies

Mark Jongeling
Administrator
Forum|alt.badge.img+23
  • Administrator
  • 3936 replies
  • 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
  • 1 reply
  • April 17, 2025

Hi Mark,

Thanks for your response.

Ticket is created: 11533S


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings