Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
pnpsql
Posting Yak Master
246 Posts |
Posted - 2011-12-14 : 04:39:59
|
| hi team, i need to create a primary key on table, but may be there is already a primary, i need to check if already exists then need not to create .please help me..challenge everything |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-14 : 04:57:21
|
| trysp_pkeys 'table name'if there's pk it will return column info------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
hirecrishecom
4 Posts |
Posted - 2011-12-14 : 05:34:57
|
| First of all you know about what is Primary key ...On Sql in your table click right click on field in which you want to set primary key ..if you want to know then there is tree view in which keys appear on that then click on that ...OR try this sp_Pkeys "Table name"<removed signature spam> |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2011-12-14 : 07:55:11
|
| ORYou could try sp_pkeysMark this as accepted if this helped you!http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspxHow to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
|
|
|