is there more the two primary key in a single table?

Answer Posted / selvaraj.v

In SQL Server 2000,

Query :
-------

create table BookDetails
(
Book_ID int identity(1,1) not null primary key,
Book_Title varchar(20),
Book_Type varchar(15),
Book_Author varchar(25),
Book_Edition float,
Book_Publisher varchar(20),
Book_Pub_Year datetime,
Book_Price int primary key
)

Answer :
--------

Server: Msg 8110, Level 16, State 1, Line 1
Cannot add multiple PRIMARY KEY constraints to
table 'BookDetails'.

Reply Answer:
-------------
So,Can't Create more Primary Keys in a Table.

Is This Answer Correct ?    13 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When we should use @@error?

540


What do you understand by physical_only option in dbcc checkdb?

576


What is the purpose of self join?

499


Explain the steps to create and execute a user-defined function in the sql server?

528


Write a sql query to display the current date?

631






If you want to send some data from access database to sql server database. What are different component of ssis will you use?

504


How to change parameter value inside the report?

104


What is the difference between an index and a unique index?

544


What is the syntax for encrypting a column in SQL Server?

553


What is transact-sql ddl trigger?

631


Explain syntax for dropping triggers?

517


How to enable tcp/ip protocol on a sql server?

587


What is the difference between substr and charindex in the sql server?

508


What happens if time-only values are provided as date and time literals?

528


Do you know how to implement service broker?

533