Back
I want to create tables in SQL Server 2008, but I don't know how to create a composite primary key. How can I achieve this?
Try using the below code:
create table my_table ( column_a integer not null, column_b integer not null, column_c varchar(50), primary key (column_a, column_b));
create table my_table (
column_a integer not null,
column_b integer not null,
column_c varchar(50),
primary key (column_a, column_b)
);
31k questions
32.8k answers
501 comments
693 users