Improvement to support for filtered indexes
Considering the following code works:
CREATE TABLE TableName (ColumnName varchar(10))
CREATE INDEX IndexName on TableName (ColumnName)
ALTER TABLE TableName alter column ColumnName varchar(11) — increasing the length of an already indexed column
Why does SQL return error 5074 for the following code?
CREATE TABLE TableName (ColumnName varchar(10))
CREATE INDEX IndexName on TableName (ColumnName) where ColumnName <> ”
ALTER TABLE TableName alter column ColumnName varchar(11) — increasing the length of an already indexed column
This seems like an arbitrary failure. The indexing structure has not changed by increasing the varchar for the column as evidenced by it working on the non filtered index example.
Msg 5074, Level 16, State 1, Line 8
The index ‘IndexName’ is dependent on column ‘ColumnName’.
Msg 4922, Level 16, State 9, Line 8
ALTER TABLE ALTER COLUMN ColumnName failed because one or more objects access this column.
Considering the following code works: CREATE TABLE TableName (ColumnName varchar(10))
CREATE INDEX IndexName on TableName (ColumnName)
ALTER TABLE TableName alter column ColumnName varchar(11) — increasing the length of an already indexed column Why does SQL return error 5074 for the following code?CREATE TABLE TableName (ColumnName varchar(10))
CREATE INDEX IndexName on TableName (ColumnName) where ColumnName <> ”
ALTER TABLE TableName alter column ColumnName varchar(11) — increasing the length of an already indexed columnThis seems like an arbitrary failure. The indexing structure has not changed by increasing the varchar for the column as evidenced by it working on the non filtered index example. Msg 5074, Level 16, State 1, Line 8The index ‘IndexName’ is dependent on column ‘ColumnName’.Msg 4922, Level 16, State 9, Line 8ALTER TABLE ALTER COLUMN ColumnName failed because one or more objects access this column. Read More