sql - Query XML in multiple records -


I am working with the Dynamics Business Portal. In an attempt to join the user's ad username with the GP Dynamix EmployIDID, I have found some tables that will help me with making this hash. The only table in the business portal tables can be found which will be tied to the GP from the business portal [MbfRoleUser] Enough banner, here is some sample data and how would I like to display it.

  Declared table table (User Iderative (50), Constitution varchar (200)) @ Valid values ​​('D8851830-EF23-44BE-BB17-0008D70F9F5B', '& lt; entityKey & gt; & lt; Microsoft.Dynamics.Common.Company.Company ID = "1" /><Microsoft.Dynamics.Hrm.Entity.Employee id = "002,001" / & gt; & lt; / entityKey & Gt; '), (' 78E42A10-D7CE-4B40-86F2-001549F5A3C2 ',' entityKey & gt; & lt; Microsoft.Dynamics.Common.Company.Company ID = "1" /> & lt; Microsoft.Dynamics.Hrm.Entity.Employee id = "001,079" / & gt; & lt; / entityKey & gt; '), (' 1F899A87-6186-4E2B-BA18-0076A4D95836 ',' & lt; entityKey & gt; & lt; Microsoft. Dynamics.Common.Company.Company ID = "1" /><.Microsoft.Dynamics.Hrm.Entity.Employee id = "001997" / & gt; & lt; / entityKey & gt; ') , ( 'CB043358-0B16-4055- A806-00A63964C1A9', '& lt; entityKey & gt; & lt; Microsoft.Dynamics.Common.Company.Company ID = "1" /><Microsoft.Dynamics.Hrm.Entity .Employee ID = "001,557" /> & Lt; / Institution & gt; '), (' 3EF8C35D-6227-486 e-B86B-00BD5991E188 ',' & lt; entityKey & gt; & lt; Microsoft.Dynamics.Common.Company.Company ID = "1" /><Microsoft.Dynamics .hrm.Entity.Employee ID = "001,740" />  
  UserID CompanyID Employeeid -------- & entity / Entry & gt; '------ ------ ---------- D8851830-EF23-44BE-BB17-0008D70F9F5B 1 002001 78E42A10-D7 CE-4B40-86F2-001549F5A3 C 2 1 001079 1 F 8 99 A 87-6186-4 E2 B BA18-0076A4D95836 1 001,997 CB043358-0B16-4055-A806-00A63964C1A9 1 001,557 3EF8C35D-6227-486A-B86B-00BD5991E188 1 001,740  < / Pre> 

If possible, I want to do this without using. Yes, it can work for this example, but other conditions are max. I would like to know how to do this by complex XML and I would like to know how to do it.

Finally, I have a table [MbFuser window endpoint], in which the other column of the user name in the format of the domain username Username is also included

If an employee knows better place to pull ID, then that will also work as well as the GP employee ID with the AD user name. Need to render.

Which are curious, we are building an employee directory using data in GP, ​​but a user in the directory will be allowed to opt out of publishing personal personal information, so tie ED . First, enter the "component" field as XML - Type this field dataet in the Dynamics / GP database. NVARCHAR. Then, use Xquery to extract values ​​from XML fields. See the examples given below:

  Select UserID, CAST (t.Constituent AS XML) .value ('(/ entityKey/Microsoft.Dynamics.Common.Company.Company/@ID) Company ID, Cast (T. Consecutant AS XML) as [1] ',' Int '). Value ('(/ unit / Microsoft Dynamics HRM. Entitie IMPB / IID)' [1] ',' Wirt (10) ') To answer the second part of your question, this is the only place where I The employee is stored in the same table with UserAid.  

P>

I hope it helps!


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -