Hi
am new in asp.net , i want create tables in sql server 2008, actually i dont know how to create composite primary key.CAN ANYBODY HELP ME .Advance in thanks
Hi
am new in asp.net , i want create tables in sql server 2008, actually i dont know how to create composite primary key.CAN ANYBODY HELP ME .Advance in thanks
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 UserGroup
(
[User_Id] INT NOT NULL,
[Group_Id] INT NOT NULL
CONSTRAINT PK_UserGroup PRIMARY KEY NONCLUSTERED ([User_Id], [Group_Id])
)
Via Enterprise Manager...
To see the SQL you can then right click on the Table > Script Table As > Create To