this gets confusing. at https://learn.microsoft.com/en-us/answers/questions/784633/generating-a-script-for-building-a-new-index-on-a.html#answer-791781 erland posted a sample where he was able to create a filtered index on a computed column. i posted a sample there where i got an error. so far the differences are that i have a timestamp and bigint. and i think he used ints. i wonder if he has one of those other legacy settings maybe on or off? and maybe i have the opposite.
would really love to save space and use a filtered index on a computed column
hi we run 2019 and have the 2 following columns defined on a number of tables...
[ROW_VERSION_STAMP] [timestamp] NOT NULL,
[ROW_VERSION_NUMBER] AS (CONVERT([bigint],[ROW_VERSION_STAMP])),
we'd like an index on the second but only starting at a certain value. ie a filtered index. we get an error (shown below) attempting to build such an index. is there a workaround? i'm even thinking about building it instead on the binary(8) timestamp.
Filtered index 'revise' cannot be created on table 'dbo.revised1' because the column 'ROW_VERSION_NUMBER' in the filter expression is a computed column. Rewrite the filter expression so that it does not include this column.