Avatar of Lee Redhead
Lee RedheadFlag for United Kingdom of Great Britain and Northern Ireland

asked on 

Best way to search data from Web Service against a SQL Stored Procedure

Hello,

I feel I may be in a little over my head with this one and could do with some advice.

Currrently I am running a database for searching through technical data for a system and returning this information via a perl script from a stored procedure. This information is then used by another company for their front end.

I have now been asked to link into a customer database to refine the information that is being returned and have become stuck.

Firstly the data being retuned is from a web service which I have very little experiance of so am unsure how to handle the data.

Secondly after the data has been compared I then need to create a list of items that were removed from the technical data due to customer history then create a reference so that the record can be reproduced at a later date.

Now if it was all in SQL I could handle it fine as I could return the data from the Web Service into a temporary table and perform the comparisons I need, generate the code and then send the information as I do now.

What I am struggling with is getting the data into SQL, searched online and found examples using CLR but there are several methods and I am unsure which one to use. One I tried didn't seem to work.

The option would be to create my own web service, return the data as I do now to that then request the data from the other web service and then compare the two data sets.

Ideally I would like to keep it all in SQL as I only need to worry about one thing instead of three but are there any things I should be aware of doing this? Also what is the best way to do this, currently the web service is returning the data as a long string which then needs to be inserted into a table, can this be done via SQL?

Thanks,

Lee

Microsoft SQL Server 2008WCF

Avatar of undefined
Last Comment
Lee Redhead
Avatar of Aaron Jabamani
Aaron Jabamani
Flag of United Kingdom of Great Britain and Northern Ireland image

Pass the data as xml to to your SQL.So that all retrival and comparision can be done in SQL and final result can be returned from SQL.
Avatar of Lee Redhead
Lee Redhead
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Thank you for that, I figured that would be the easiest way to do it.

Now my next question is how is the best method of getting the data to SQL from a WebService. I know it is using CLR but I have not done that before. Looked for a few examples on how to do this but some list options I don't have or they don't seem to work.

Is there an easy guide on how to do this quite simply?
ASKER CERTIFIED SOLUTION
Avatar of Aaron Jabamani
Aaron Jabamani
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Lee Redhead
Lee Redhead
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

The other way round, I am trying to work out how to read the data from the web service in an SQL stored proc.
Avatar of Lee Redhead
Lee Redhead
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Passing the XML directly to SQL from a web service worked perfectly, then used sp_xml_preparedocument to select from OpenXML to read the data into a table.
Microsoft SQL Server 2008
Microsoft SQL Server 2008

Microsoft SQL Server 2008 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. Major improvements include the Always On technologies and support for unstructured data types.

50K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo