try alter the table column

ALTER TABLE OneTable ALTER COLUMN ID bigint

In case of primary key or FK dependency, it would fail with below error:

Msg 5074, Level 16, State 1, Line 1 The object ‘PK_OneTable’ is dependent on column ‘ID’. Msg 4922, Level 16, State 9, Line 1 ALTER TABLE ALTER COLUMN ID failed because one or more objects access this column.

Solution 1

  1. Create a new bigint column in the table
  2. Update that new column with the values from the int column
  3. Delete the int column
  4. Rename the bigint column


Ref:

https://www.sqlshack.com/solve-identity-crisis-sql-server/