Put in the wrong data type for pk, cannot change because it is FK for another table I'm trying to change the PK Department.DeptId to char(8), however it is an FK in employee. Doing two alters in 1 query throws an error for the first statement. Changing it in the edit window does the same. Any idea how to change it in both places so that it does not throw an error?
You first need to drop the foreign key constraint between the two tables. After that you can alter the column the employee table. You may need to drop the primary key constraint as well as any other indexes on the Department table that has DeptId in it before you update the column, but you can try altering the column before you drop the indexes/pk. Once you have the column altered you can reapply the primary key constraint and the other indexes you removed from the Department table as well as the foreign key constraint between the Department table and the Employee table. 

alter table employee drop constraint &lt;put constraint name here&gt;


If you use SMSS to generate the drop and create scripts this will save you time and ensure that you keep the names as well as the columns that are used in the index

Drop index &lt;index name here&gt; on Department


You will need to repeat the above for each index

alter table Department drop constraint &lt;put primary key name here&gt;

alter table Department alter column DeptId char(8) not null

alter table Department add constraint [your pk name] primary key(DeptId)

alter table employee add constraint [foreign key name] foreign key DeptId references Department (DeptId)


Run the create portion of the index scripts that you created