I ran the following query in Query Analyzer for a 7 column table.
SELECT c.name,c.colid FROM syscolumns c WHERE c.id=925962375 ORDER BY
c.colid
The results were:
I_CSD 1
X_STE_XML 2
I_USR_LCK 4
T_CRT_RCD 5
I_USR_CRT_RCD 6
T_UDT_RCD 7
I_USR_UDT_RCD 8
If I use the information_schema view (SELECT column_name,
ordinal_position FROM information_schema.columns WHERE table_name =
'CSD_XML') I get the same results.
The problem is that the colids go from 2 to 4 and the colids go
through 8 when there are only 7 columns.
At one time there was another column in the table, but it has since
been dropped and isn't there anymore. It seems that the colids in
syscolumns did not update when the column was dropped.
Is this because of the way I dropped the column? Is there anything I
can do now that it has happened?