Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

problematic xml

$
0
0
Hello,I have a real weird xml that I need to put in a table in columns. The problem is that the xml itself repeats itself over and over again.so when i write the code to parse it it keeps going to the first part[code="sql"]x.value('(clear-fraud/clear-fraud-stabilities/clear-fraud-stability/name[1]/text())[1]',[/code]how do i tell it to make the columns in the order of the xml?here is the xml code[code="xml"]<xml-response> <clear-fraud> <clear-fraud-stabilities> <clear-fraud-stability> <name>drivers_license</name> <one-minute-ago>1</one-minute-ago> <ten-minutes-ago>1</ten-minutes-ago> <one-hour-ago>1</one-hour-ago> <twentyfour-hours-ago>1</twentyfour-hours-ago> <seven-days-ago>1</seven-days-ago> <fifteen-days-ago>1</fifteen-days-ago> <thirty-days-ago>1</thirty-days-ago> <ninety-days-ago>1</ninety-days-ago> <threesixtyfive-days-ago>1</threesixtyfive-days-ago> </clear-fraud-stability> <clear-fraud-stability> <name>bank_account</name> <one-minute-ago>1</one-minute-ago> <ten-minutes-ago>1</ten-minutes-ago> <one-hour-ago>1</one-hour-ago> <twentyfour-hours-ago>1</twentyfour-hours-ago> <seven-days-ago>1</seven-days-ago> <fifteen-days-ago>1</fifteen-days-ago> <thirty-days-ago>1</thirty-days-ago> <ninety-days-ago>1</ninety-days-ago> <threesixtyfive-days-ago>1</threesixtyfive-days-ago> </clear-fraud-stability> <clear-fraud-stability> <name>home_address</name> <one-minute-ago>1</one-minute-ago> <ten-minutes-ago>1</ten-minutes-ago> <one-hour-ago>1</one-hour-ago> <twentyfour-hours-ago>1</twentyfour-hours-ago> <seven-days-ago>1</seven-days-ago> <fifteen-days-ago>1</fifteen-days-ago> <thirty-days-ago>1</thirty-days-ago> <ninety-days-ago>1</ninety-days-ago> <threesixtyfive-days-ago>1</threesixtyfive-days-ago> </clear-fraud-stability> <clear-fraud-stability> <name>zip_code</name> <one-minute-ago>1</one-minute-ago> <ten-minutes-ago>1</ten-minutes-ago> <one-hour-ago>1</one-hour-ago> <twentyfour-hours-ago>1</twentyfour-hours-ago> <seven-days-ago>1</seven-days-ago> <fifteen-days-ago>1</fifteen-days-ago> <thirty-days-ago>1</thirty-days-ago> <ninety-days-ago>1</ninety-days-ago> <threesixtyfive-days-ago>1</threesixtyfive-days-ago> </clear-fraud-stability> <clear-fraud-stability> <name>home_phone</name> <one-minute-ago>1</one-minute-ago> <ten-minutes-ago>1</ten-minutes-ago> <one-hour-ago>1</one-hour-ago> <twentyfour-hours-ago>1</twentyfour-hours-ago> <seven-days-ago>1</seven-days-ago> <fifteen-days-ago>1</fifteen-days-ago> <thirty-days-ago>1</thirty-days-ago> <ninety-days-ago>1</ninety-days-ago> <threesixtyfive-days-ago>1</threesixtyfive-days-ago> </clear-fraud-stability> <clear-fraud-stability> <name>cell_phone</name> <one-minute-ago>1</one-minute-ago> <ten-minutes-ago>1</ten-minutes-ago> <one-hour-ago>1</one-hour-ago> <twentyfour-hours-ago>1</twentyfour-hours-ago> <seven-days-ago>1</seven-days-ago> <fifteen-days-ago>1</fifteen-days-ago> <thirty-days-ago>1</thirty-days-ago> <ninety-days-ago>1</ninety-days-ago> <threesixtyfive-days-ago>2</threesixtyfive-days-ago> </clear-fraud-stability> <clear-fraud-stability> <name>work_phone</name> <one-minute-ago>1</one-minute-ago> <ten-minutes-ago>1</ten-minutes-ago> <one-hour-ago>1</one-hour-ago> <twentyfour-hours-ago>1</twentyfour-hours-ago> <seven-days-ago>1</seven-days-ago> <fifteen-days-ago>1</fifteen-days-ago> <thirty-days-ago>1</thirty-days-ago> <ninety-days-ago>2</ninety-days-ago> <threesixtyfive-days-ago>3</threesixtyfive-days-ago> </clear-fraud-stability> <clear-fraud-stability> <name>monthly_income</name> <one-minute-ago>1</one-minute-ago> <ten-minutes-ago>1</ten-minutes-ago> <one-hour-ago>1</one-hour-ago> <twentyfour-hours-ago>1</twentyfour-hours-ago> <seven-days-ago>1</seven-days-ago> <fifteen-days-ago>1</fifteen-days-ago> <thirty-days-ago>3</thirty-days-ago> <ninety-days-ago>3</ninety-days-ago> <threesixtyfive-days-ago>5</threesixtyfive-days-ago> </clear-fraud-stability> <clear-fraud-stability> <name>email_address</name> <one-minute-ago>1</one-minute-ago> <ten-minutes-ago>1</ten-minutes-ago> <one-hour-ago>1</one-hour-ago> <twentyfour-hours-ago>1</twentyfour-hours-ago> <seven-days-ago>1</seven-days-ago> <fifteen-days-ago>1</fifteen-days-ago> <thirty-days-ago>1</thirty-days-ago> <ninety-days-ago>1</ninety-days-ago> <threesixtyfive-days-ago>1</threesixtyfive-days-ago> </clear-fraud-stability> </clear-fraud-stabilities> </clear-fraud></xml-response> [/code]thanksastrid :-)

Viewing all articles
Browse latest Browse all 3145

Trending Articles