I understand that the question has already been marked as an answer, but for some it may be useful to show how to include sys.index_columns(in addition to sys.indexes) your query in order to associate the actual primary key index in the columns of the table. Example:
select
t.Name as tableName
,c.name as columnName
,case when pk.is_primary_key is not null then 1 else 0 end as isPrimaryKeyColumn
from sys.tables t
inner join sys.columns c on t.object_id = c.object_id
left join sys.index_columns pkCols
on t.object_id = pkCols.object_id
and c.column_id = pkCols.column_id
left join sys.indexes pk
on pkCols.object_id = pk.object_id
and pk.is_primary_key = 1
where
t.name = 'MyTable'
source
share