XML query against SQL Server SSIS DataProfiler xml file in Powershell does not work. -


I am trying to figure out the attribute values ​​from the XML file attached below. Specifically, I use the " name , SqlDbType and so on. Columns "" Colmnolratioprofail "node XML output file element code comes as a part of SQL Server 2008 SSIS DataProfiler work.

However, I have many ways Have tried (some of them have tried to see method 1 and below method 2. I can not work it. Any suggestions?

  # on TMM Save as: \ # ------------- ---------- & lt ;? Xml version = "1.0"? & Gt; Dataprofile xmlns: xsi = "Http://www.w3.org/2001/XMLSchema-instance" xmlns: xsd = "http://www.w3.org/2001/XMLSchema" xmlns = " http://schemas.microsoft.com/sqlserver/2008/DataDebugger/ "& gt; & lt; data sources & gt; & lt; DtsDataSource id =" {45277997- 59B4-4A95-909E-7804F0761FA1} "Name =" Detabeskon "& gt; Ditisikakshn Manejraidi & gt; Databeskon & lt; / DtsConnectionManagerID & gt; & lt; / DtsDataSource & gt; & lt; DtsDataSource id =" {BAEE1FCA-E5A2-4C3C-A1B6-100B3B681397} "name =" Table .xml "& gt; DtsConnectionManagerID & gt; Table.xml & lt; / DtsConnectionManagerID & gt; & Lt; / DtsDataSource & gt; & Lt; / DataSources & gt; & Lt; DataprofylOutput & gt; & Lt; Pr ofiles & gt; & Lt; ColumnNullRatioProfile Profile RequestID = "NullRatioReq" IsExact = "true" & gt; & Lt; DataSourceID & gt; {45877997-59B4-4A95-909E-7804F0761FA1} & lt; / DataSourceID & gt; & Lt; Table Datasource = "XVRTFD585 / SQL95" Database = "BusinessData" Schema = "General" Table = "Email_Notification_Luckup" Route = "- 1" /> & Lt; Column Name = "email URL_ID" SqlDbType = "Int" MaxLength = "0" precision = "10" scale = "0" Elsiaidi = "- 1" codepage = "0" Isjelbl = "false" string Comparivesn = " 0 "/> & Lt; NullCount & gt; 0 & lt; / NullCount & gt; & Lt; / ColumnNullRatioProfile & gt; & Lt; ColumnNullRatioProfile ProfileRequestID = "NullRatioReq1" isExact = "true" & gt; & Lt; DataSourceID & gt; {45CC99B2-E396-4CFA-A1F5-4E703F04E9E7} & lt; / DataSourceID & gt; & Lt; Table Datasource = "XVRTFD 0585 \ SQL95" Database = "BusinessData" Schema = "General" Table = "Lookup_Codius" Route = "5979114" /> & Lt; Column Name = "TRANS_ID" SqlDbType = "decimal" Maksleang = "0" Precision = "9" scale = "0" Elsiaidi = "- 1" codepage = "0" Islail = "true" string Comparivesn = "0 "/> & Lt; NullCount & gt; 5979114 & lt; / NullCount & gt; & Lt; / ColumnNullRatioProfile & gt; & Lt; / Profile & gt; & Lt; /DataProfileOutput & gt; & Lt; / DataProfile & gt; Method # 1 # -------- $ uri = "C: \ t.xml" $ xDoc = [xml] (Get-Content $ Yuri) $ XDoc.DataProfile.DataProfileOutput.Profiles.ColumnNullRatioProfile.Column | Select Name # Method 2 (Use LINQ) # -------- $ uri = "C: \ t.xml" [Reflection. Assembly] :: Load Vertical Alias ​​("System.Xml.Linq"). Out Null $ XDoc = [System.Xml.Linq.XDocument] :: Load ($ Yuri) $ XDoc.Descendants ("ColumnNullRatioProfile") | GetAttribute ("name"). Value}  

$ XDoc.DataProfile.DataProfileOutput.Profiles.ColumnNullRatioProfile |% {$ _ column} | Choose Name


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -