"sql get list of domains and the tables that use them" Code Answer's
You're definitely familiar with the best coding language SQL that developers use to develop their projects and they get all their queries like "sql get list of domains and the tables that use them" answered properly. Developers are finding an appropriate answer about sql get list of domains and the tables that use them related to the SQL coding language. By visiting this online portal developers get answers concerning SQL codes question like sql get list of domains and the tables that use them. Enter your desired code related query in the search bar and get every piece of information about SQL code related question on sql get list of domains and the tables that use them.
sql get list of domains and the tables that use them
--Queries an sde-schema geodatabase in SQL Server
DECLARE @DOMAIN_NAME NVARCHAR(MAX);
SET @DOMAIN_NAME = 'Material';
DECLARE @CLASS_DEFS TABLE
(
Name nvarchar(max),
Definition XML
)
--Insert records to temporary record set
INSERT INTO @CLASS_DEFS
SELECT
sde.gdb_items.Name,
sde.gdb_items.Definition
FROM
-- Get the domain item's UUID.
((SELECT GDB_ITEMS.UUID AS UUID
FROM sde.gdb_items INNER JOIN sde.gdb_itemtypes
ON sde.gdb_items.Type = sde.gdb_itemtypes.UUID
WHERE
sde.gdb_items.Name = @DOMAIN_NAME AND
sde.gdb_itemtypes.Name IN ('Coded Value Domain','Range Domain')) AS Domain
-- Find the relationships with the domain as the DestinationID.
INNER JOIN sde.gdb_itemrelationships
ON Domain.UUID = sde.gdb_itemrelationships.DestID)
-- Find the names of the origin items in the relationships.
INNER JOIN sde.gdb_items
ON Domain.UUID = sde.gdb_itemrelationships.DestID
-- Extract the field definitions.
SELECT
ClassDefs.Name AS "Class Name",
fieldDef.value('Name[1]', 'nvarchar(max)') AS "Field Name",
NULL AS "Subtype Name"
FROM
@CLASS_DEFS AS ClassDefs
CROSS APPLY
Definition.nodes('/*/GPFieldInfoExs/GPFieldInfoEx') AS FieldDefs(fieldDef)
WHERE
fieldDef.value('DomainName[1]', 'nvarchar(max)') = @DOMAIN_NAME
UNION
SELECT
ClassDefs.Name AS "Class Name",
fieldDef.value('FieldName[1]', 'nvarchar(max)') AS "Field Name",
fieldDef.value('(../../SubtypeName)[1]', 'nvarchar(max)') AS "Subtype Name"
FROM
@CLASS_DEFS AS ClassDefs
CROSS APPLY
Definition.nodes('/*/Subtypes/Subtype/FieldInfos/SubtypeFieldInfo') AS FieldDefs(fieldDef)
WHERE
fieldDef.value('DomainName[1]', 'nvarchar(max)') = @DOMAIN_NAME
All those coders who are working on the SQL based application and are stuck on sql get list of domains and the tables that use them can get a collection of related answers to their query. Programmers need to enter their query on sql get list of domains and the tables that use them related to SQL code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about sql get list of domains and the tables that use them for the programmers working on SQL code while coding their module. Coders are also allowed to rectify already present answers of sql get list of domains and the tables that use them while working on the SQL language code. Developers can add up suggestions if they deem fit any other answer relating to "sql get list of domains and the tables that use them". Visit this developer's friendly online web community, CodeProZone, and get your queries like sql get list of domains and the tables that use them resolved professionally and stay updated to the latest SQL updates.