Last active
March 13, 2019 16:27
-
-
Save steveoh/f86da860642f2d88aa5ef9474955880c to your computer and use it in GitHub Desktop.
get domain name/code/value from an SDE database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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