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 does it mean to normalize data?

515


What are rest-style architecture's?

149


What are the triggers in sql?

557


What is transaction server consistency?

545


What is a ddl statement?

511






What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting is possible?

488


How can we migrate from SQL server to SQL Azure?

92


What is the optimization being performed in oracle and SQL Server?

630


Explain table valued parameters in sql server? Why tvp used?

557


How to delete an existing database user?

535


you have separate development and production systems you want to move a copy of a development database into production to do this, you do a backup on the development system and restore to the production system after a few minutes, you begin getting calls from several customers saying that they are denied access to the system why? : Sql server administration

553


What do you understand by user-defined function in the sql server?

488


What is the difference between varchar and varchar(max) datatypes?

555


Does a sql server 2005 select statement require a from?

578


How to rebuild the master database?

577