Write below query:-
select tablename,
left(col,len(col)-1) as column_name
from
(
select distinct tab.table_name tablename,
(
select col.column_name +',' as [text()]
from information_schema.constraint_column_usage col
where
col.constraint_name = tab.constraint_name and col.table_name = tab.table_name and constraint_type = 'primary key'
for xml path ('')
) col
from information_schema.table_constraints tab
)t
where t.col is not null
order by tablename;