I have a table with the following content
Id | Guid | XmlDefinitionId
1 | 5a0bfc84-13ec-4497-93e0-655e57d4b482 | 1
2 | e28e786b-0856-40b6-8189-0fbd68aa3e45 | 1
And in another table the following XML structure stored:
<ActionActivity DisplayName="DisplayName 1" IsSkipped="False" Id="5a0bfc84-13ec-4497-93e0-655e57d4b482">...</ActionActivity>
<p:Sequence DisplayName="Prerequisites">
<ActionActivity DisplayName="Inner DisplayName 1" IsSkipped="False" Id="e28e786b-0856-40b6-8189-0fbd68aa3e45">...</ActionActivity>
</p:Sequence>
<ActionActivity DisplayName="DisplayName 2" IsSkipped="False" Id="dcc936dd-73c9-43cc-beb4-c636647d4851">...</ActionActivity>
The table containing the XML have the following structure:
Id | XML
1 | (XML Structure defined above here)
Based on the Guid I want to show the displayname. At the moment I have the following query that returns null at the moment. Later I want for every guid from the first table show the displayname.
SELECT
Workflow
,CAST(Workflow as XML).value('data(//ActionActivity[@Id="73c9-43cc-beb4-c636647d4851"])[1]', 'nvarchar(50)') as displayname
FROM SerializedData
Anyone ideas to show the displayname with a sql query?