Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / sandesh kadam

No,

Is This Answer Correct ?    34 Yes 12 No

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

Answer / vinay singh

There are no more than one Primary Key in a single table,
but we can make a Primary key using combination of more than
one column...
Example..

CREATE TABLE [LoginHist] (
[UserId] [char] (15) NOT NULL ,
[LogDate] [smalldatetime] NOT NULL ,
[ClientIp] [char] (15) NOT NULL ,
[LoginCount] [int] NULL DEFAULT (0),
CONSTRAINT [PK_LoginHist] PRIMARY KEY CLUSTERED
(
[UserId],
[LogDate],
[ClientIp]
) ON [PRIMARY]
) ON [PRIMARY]

** Vinay Singh
** Cell No - 9867774724

Is This Answer Correct ?    18 Yes 1 No

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

Answer / sandesh kadam

Guys,

Saying "yes", can you please make efforst in explaining how
to have two primary keys on the table.

Regards
Sandesh

Is This Answer Correct ?    12 Yes 3 No

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

Answer / kesavan.g

Yes.

Is This Answer Correct ?    18 Yes 10 No

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

Answer / 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

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

Answer / gowthami radhakrishnan

no only one primary key for a table.but primary key can be
uesd in combination with other key known as composite key.

Is This Answer Correct ?    7 Yes 0 No

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

Answer / jahir

refer below, actually its not primary key, Its Composite Key

CREATE TABLE [LoginHist] (
[UserId] [char] (15) NOT NULL ,
[LogDate] [smalldatetime] NOT NULL ,
[ClientIp] [char] (15) NOT NULL ,
[LoginCount] [int] NULL DEFAULT (0),
CONSTRAINT [PK_LoginHist] PRIMARY KEY CLUSTERED
(
[UserId],
[LogDate],
[ClientIp]
) ON [PRIMARY]
) ON [PRIMARY]

Is This Answer Correct ?    6 Yes 1 No

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

Answer / sivakumar

No, When creating table using script we can create primary
key another one is called composite key that means
combination of more than
one column...



CREATE TABLE [LoginHist] (
[LogDate] [smalldatetime] NOT NULL ,
[ClientIp] [char] (15) NOT NULL ,
[LoginCount] [int] NULL DEFAULT (0),
CONSTRAINT [PK_LoginHist] PRIMARY KEY CLUSTERED
(
[LogDate],
[ClientIp]
) ON [PRIMARY]
) ON [PRIMARY]

Is This Answer Correct ?    4 Yes 0 No

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

Answer / asas

NO guys

create table prk(eno int primary key, dno int primary key)


Msg 8110, Level 16, State 0, Line 1
Cannot add multiple PRIMARY KEY constraints to table 'prk'.

Is This Answer Correct ?    4 Yes 1 No

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

Answer / vijay

No, more than one primary key in a table
but combination of more than one column in a
primary key

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More SQL Server Interview Questions

How to display n-1 columns from n number of columns, from a single table in MS SQL server 2005?

2 Answers  


Explain the difference between functions and stored procedures in sql server?

0 Answers  


What happens on checkpoint?

0 Answers  


What is the difference between Normalization and De-normalization?

0 Answers   TCS,


What are the two modes of authentication in sql server?

0 Answers  


How can you transfer data from a text file to a database table? Or how can you export data from a table to a comma delimited (csv) file? Or how can you import data from ms access to a table in a database? Or how can you export data from a table to an excel file?

0 Answers  


How to select all columns of all rows from a table with a select statement in ms sql server?

0 Answers  


How do I schedule a sql server profiler trace?

0 Answers  


What is the difference between left and right outer join?

0 Answers  


Why olap is used?

0 Answers  


What is the syntax to execute the sys.dm_db_missing_index_details? : sql server database administration

0 Answers  


1. Tell me your daily activities 2. If sql server installation fails at time installation what will do 3. Where does the sql server installation log details are stored 4. After the installation what will you do for memory configuration 5. What is the difference between SQL max maximum memory and AWE memory 6. How will you configure AWE memory 7. How will setup an email alert for the backup job 8. After the SQL installation what are the jobs will you configure 9. What does –g mean in the sql startup parameter 10. What is the difference between Bulked log and Full recovery model 11. What is the difference between mirroring and log shipping 12. What are the steps to be followed before in-place up gradation 13. After installing the patch the sql server does not start and application team tells to rollback the changes .In this scenario what will you do

0 Answers   CSC, IBM,


Categories