How to alter type of a column who is references as Foreign key in other table?

Viewed 1043

I want to change the dataType of primary key from varchar to bigint.

I tried following command.

ALTER TABLE dbo.Company
ALTER COLUMN Id bigint

but it is not working as this column is referenced as the foreign key in other tables.

How can i change its type without loosing data of the table through Sql Query?

1 Answers
Related