I need to list all the table, column, schema and the owner names in all of the databases and I have written the code below.
I am not certain where to get the schema owners details to add to my query.
select c.name as colomn_name , t.name as table_name , s.name as schema_name
from sys.columns c
inner join sys.tables t on c.object_id=t.object_id
INNER JOIN sys.schemas AS s ON t.[schema_id] = s.[schema_id]
Can anyone help with this?