In the primary key have a multiple field or not?

Answer Posted / prashanth kumar

Yes , it have multiple fields.Run below query and creating
primary key on p_Id and LastName.

CREATE TABLE Persons
(
P_Id int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255),
CONSTRAINT pk_PersonID PRIMARY KEY (P_Id,LastName)
)

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an execution plan?

743


What are drillthrough reports?

128


What is clr ddl trigger?

729


How to find index size for each index on table?

770


How is SQL Azure different than SQL server?

116






What is difference between getdate and sysdatetime in sql server 2008?

778


What is logshipping and its purpose?

742


What is sql server transaction log file?

709


How to generate create table script on an existing table in ms sql server?

845


What are the restrictions applicable while creating views? : SQL Server Architecture

754


what is denormalization and when would you go for it? : Sql server database administration

895


How exceptions can be handled in sql server programming?

705


What is a subquery in a select query statement in ms sql server?

805


What do you mean by an execution plan?

775


What is the purpose of optimization?

723