See an example example of how to increase the size of a primary column.
- create a sample table
create table abc (id varchar(10) primary key)
- constratint
select object_name(object_id),* from sys.key_constraints where object_name(parent_object_id) = 'abc'
-
ALTER TABLE abc
DROP CONSTRAINT PK__abc__3213E83F74EAC69B
PK__abc__3213E83F74EAC69B ,
sys.key_constraints
- null
ALTER TABLE abc alter column id varchar(20) NOT NULL;
-
ALTER TABLE abc
ADD CONSTRAINT MyPrimaryKey PRIMARY KEY (id)