I am trying to add a column in between columns and getting the following error:
Msg 259, Level 16, State 1, Line 10: Ad hoc updates to system catalogs are not allowed.
This is what I have done:
select * from
[INFORMATION_SCHEMA].COLUMNS
where TABLE_NAME = 'Customers'
Alter table Customers
Add ContactName varchar(20)
Update INFORMATION_SCHEMA.COLUMNS
set ORDINAL_POSITION = 3
where TABLE_NAME = 'Customers ' and COLUMN_NAME = 'ContactName'
The column should move to the third position.