George,
There's more than one way to do that in In Sql Server. In addition to SQL-DMO, you can use sp_pkeys system stored procedure or INFORMATION_SCHEMA view
USE pubs
EXEC sp_pkeys sales, dbo, pubs
SELECT constraint_name AS PK_name
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
WHERE table_name = 'sales'
AND constraint_type = 'PRIMARY KEY'
>Alex,
>
>The reason I asked about the whether it's a VFP or SQL Server table, is that the methods would be different.
>
>In VFP you could also use the PRIMARY() function. In SQL, you'd have to use SQLDMO.
--sb--