您可以创建一个持久化的计算列,然后对其进行索引,请参阅在计算列上创建索引
alter table add newcolumn as cast(oldcolumn as varchar(24)) persisted;create index table_newcolumn on table (newcolumn);

您可以创建一个持久化的计算列,然后对其进行索引,请参阅在计算列上创建索引
alter table add newcolumn as cast(oldcolumn as varchar(24)) persisted;create index table_newcolumn on table (newcolumn);