
SQL query to read and pivot XML data
- or -
Post a project like this- Posted:
- Proposals: 3
- Remote
- #1332339
- Awarded
Description
Database management system (DBMS): Microsoft SQL Server
Description of requirements/functionality: I have XML data in a table that I need formatted in a specific way.
As this will end up being large, cursors aren't really an option. I'm looking for a clever set based solution.
*edit*
Due to formatting issues I have pasted pictures of the xml data and how the results should look like.
There can be any number of cars.
There can be any number of pictures, zero included.
Specific technologies required: T-SQL
Extra notes: This would be easy in a procedural language such as C# but it needs to happen in SQL.
A script to create sample data for you to work with is attached.
Brynjar H.
100% (2)New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-

Dear Brynjar,
You wrote:
Data is imported to a table and the proc / logic I'm asking for will decode and display the results in the pre defined format.
***
Does it mean that you already have a vehicleimport table and you want to show result in predefined XML format?
Means first time XML to table is already done at your end and now you are looking to decode and display again in XML?
ThanksBrynjar H.24 Oct 2016Take a look at the SQL script attached, that explains it pretty much.
-

Hi Brynjar,
Are you still accepting bids on the project?
Which version of SQL Server are you using?
ThanksBrynjar H.24 Oct 2016Still open for offers. SQL 2016 (Azure).
-

Hi,
can you use Xpath?
Thank you,
LucyBrynjar H.23 Oct 2016This has to be done exclusively in the database.
Data is imported to a table and the proc / logic I'm asking for will decode and display the results in the pre defined format. -

Hi Brynjar,
Please share me the details. The inpur, and the output template.
It will help me to come up with a sample work.
Thanks
Sumit
SaS TechnologiesBrynjar H.24 Oct 2016Hi Sumit,
The input and output is clearly defined in the description. Have a look at the attachments where you find the SQL script to get you started.
Any post 2005 SQL will do although I use the version found in Azure. -

Hi Brynjar,
could you please provide a sample of the XML data as PPH strips all tags?
Thank you,
LucyBrynjar H.23 Oct 2016Thanks for the tip, I have updated the ad.