Skip to main content

I ran into an error when I tried to build my database.
It's not the first time I ran into errors during execution of the sourcecode but this one is new for me:

 

An unknown error occurred while executing '
create nonclustered index "so_slaughter_registration"
on "slaughter_registration"
(
"slaughter_date" desc,
"day_sequence_number" desc
"slaughter_registration_id" desc,
)
'.

Error: 'Incorrect syntax near 'slaughter_registration_id'.'.

I can clearly see the incorrect syntax as there is no comma after the middle desc… And there is a rogue comma after the last desc...
But I'm pretty sure this piece of code is generated by TW from the indexes tab on datatable->Tables

How can I influence this?

I think I see where it happens but I cannot edit it:
 

I fixed it by completely removing the index and recreate it which also resulted in correct priorities of the columns:
 

 

@Alban_T Seeing it starting with “so_” that means it is from a sorting order done on the table.

Check the setting there starting at menu item “User interface” → “Subject” →  → “Data” → “Sort".

If I remember correctly this issue had something to do with a duplicate “Sort no.” or a column having the same order no in the data model. I hope this will guide you towards a solution.


@Alban_T Seeing it starting with “so_” that means it is from a sorting order done on the table.

Check the setting there starting at menu item “User interface” → “Subject” →  → “Data” → “Sort".

If I remember correctly this issue had something to do with a duplicate “Sort no.” or a column having the same order no in the data model. I hope this will guide you towards a solution.

ahhh should have known that that was what so_ stood for :)
I did look at the sorting but slaughter_registration_id isn’t in the default sort.
But maybe it was before, looking at the modified by column the slaughter_registration_id was the only one that was manually added as the other two use the apppool user suggesting that it was something automated.

As mentioned before, I was able to fix it by adding the index manually and removing the other one.