.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

Can we have primary key for more than two column? In which situation we will use it Give an example

Posted By: Ramesh P     Posted Date: October 29, 2010    Points:2   Category :Sql Server
Can we have primary key for more than two column? In which situation we will use it. Give an example

Responses
Author: Deco             
Posted Date: October 29, 2010     Points: 5   

Yep, You can have it.

You have to make use of the composite key.

Please refer my answer in the below thread

http://www.dotnetspark.com/Forum/1690-explain-composite-key-with--example.aspx

Regards,
Deco
Author: sriram             
Posted Date: October 27, 2011     Points: 20   


Hi,

u cannt assign primary key for more than two columns on sigle table.to avoid duplicate values and null values

u can use primary keys..

if u need more than one primary key use composite key.

Regards
Sriram.R

www.databaseresource.blogspot.com



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend