Reputation: 4629
I want to select xml schema assigned to a xml column in my SQL Server database, from a SQL statement.
I am stuck, I've looked in information_schema.columns
with no luck, I can just alter it.
In Management Studio, in column properties under Xml Type Specification
I can set (scheme collection) I want to simply select this from SQL statement.
Thanks for your help.
Upvotes: 4
Views: 1219
Reputation: 138960
Something like this should do it.
select C2.name
from sys.columns as C1
inner join sys.xml_schema_collections as C2
on C1.xml_collection_id = C2.xml_collection_id
where C1.object_id = object_id('TableName') and
C1.name = 'ColumnName'
Upvotes: 4