0 votes
1 view
in SQL by (20.3k points)

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?

1 Answer

0 votes
by (40.4k points)

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)

);

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...