In Oracle, the following SQL will return a cursor of tables and what columns are indexed as the Primary Key for each table. What SQL will return the same for SQL Server? TIA!
select
B.Constraint_Type,
A.Index_Name,
A.Table_Name,
A.Column_Name
from
User_Constraints B, User_Ind_Columns A
where A.Index_Name = B.Constraint_Name
and B.ConstraintType = 'P'
order by A.Table_Name
Mark McCasland
Midlothian, TX USA