Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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.7k 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

Browse Categories

...