SELECT
t.name as TableName,
c.name AS ColumnName
FROM
sys.tables t
LEFT OUTER JOIN
sys.columns c
ON t.object_id = c.object_id
LEFT OUTER JOIN
sys.index_columns ic
ON ic.object_id = c.object_id
AND ic.column_id = c.column_id
INNER JOIN
sys.indexes i
ON ic.object_id = i.object_id
AND ic.index_id = i.index_id
WHERE
i.is_primary_key = 1