Today I created a new table in SQL Azure portal and by default there is an Id INT column.
Id ( int , PK , Not Null)
When I tried to change it to BIGINT it gave me the following error:
An error was encountered while applying the changes.An exception occurred
while executing the Transact-SQL statement:
ALTER TABLE [dbo].[PerformanceData]
ALTER COLUMN [Id] BIGINT NOT NULL.
The object 'PrimaryKey_029c7a8d-e6b2-43b8-94f1-98fc5b0115e3' is dependent on
column 'Id'. ALTER TABLE ALTER COLUMN Id failed because one or more objects
access this column.
Why did this happen?
Looks like the column you are trying to alter is the primary key column. You need to drop related constraints first. Something like this:
ALTER TABLE [dbo].[PerformanceData] DROP CONSTRAINT Id