Hello Esri Community,
I’m working with a Feature Class in an Enterprise Geodatabase (SQL Server) that contains fields with domains, subtypes, and attribute rules. I’m trying to create a SQL view that filters records based on a domain field (Status) with values (1, "Active") and (2, "Canceled"). The view should only return records where Status = 1.
So far, I’ve successfully created the view, but the fields with domains and subtypes are returning the codes (e.g., 1 for "Active") instead of the descriptions (e.g., "Active"). I’ve tried various approaches to retrieve the descriptions but haven’t been successful.
Details:
The domains and subtypes were created in ArcGIS Pro and assigned to fields in the feature class.
The geodatabase is stored in SQL Server (Enterprise Geodatabase).
In SQL Server Management Studio (SSMS), I can’t find the domain and subtype information in tables like GDB_ITEMS, GDB_ITEMTYPES, or GDB_ITEMRELATIONSHIPS. However, the descriptions appear correctly in ArcGIS Pro when viewing the feature class attributes.
What I’ve Tried:
Creating a SQL view that filters the Status field:
CREATE VIEW ActiveFeatureClass AS
SELECT *
FROM MyFeatureClass
WHERE Status = 1;
This works, but the domain and subtype fields return codes instead of descriptions.
Attempting to join the GDB_ITEMS table to retrieve domain descriptions, but I couldn’t locate the domain and subtype information in SSMS.
What I Need:
A way to create a SQL view that returns the descriptions for domain and subtype fields instead of the codes.
Guidance on how to access domain and subtype information stored in the geodatabase system tables in SQL Server.
Additional Notes:
Any help or guidance would be greatly appreciated! Thank you in advance.