Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
get domain name/code/value from an SDE database
SELECT
cv_domain.value('DomainName[1]', 'nvarchar(50)') AS 'DomainName',
coded_value.value('Code[1]','nvarchar(50)') AS 'Code',
coded_value.value('Name[1]','nvarchar(50)') AS 'Value'
FROM
sde.GDB_ITEMS AS items INNER JOIN sde.GDB_ITEMTYPES AS itemtypes ON
items.Type = itemtypes.UUID
CROSS APPLY
items.Definition.nodes('/GPCodedValueDomain2/CodedValues/CodedValue') AS CodedValues(coded_value)
CROSS APPLY
items.Definition.nodes('/GPCodedValueDomain2') AS CVDomains(cv_domain)
WHERE
itemtypes.Name = 'Coded Value Domain'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.