Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retreive PK/AK (UNIQUE constraint) fields

Status
Not open for further replies.

SteveDingle

Programmer
Jul 26, 2004
254
GB
Hi,

I'm working on a project in Visual Foxpro where I need to gather certain information about a SQL Server database. Hoping someone can point me in the right direction.

I need to get the field(s) which are defined as the primary key and alternate key value so I can pre-process data before sending it to SQL Server.

Is there anyway I can do this (using ODBC connection)

Thanks
Steve
 
U can get the pk in a table using:

sp_pkeys tablename


Sergio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top