Sunday, February 12, 2012

Calling web services from Query Analyzer

I've made a database change to a table to add home and
operational amounts. In an upgrade path, I need to
populate these columns with values. There is already C#
code that does the currency conversion based on comparing
transactional currency to both the home and operational
currency codes. Right now, our upgrade scripts are run
via Query Analyzer. Is there a way for me to call web
services and execute methods that have already been
written to do the currency conversion for me? I'd hate to
reinvent the wheel and rewrite code for something that's
already been in done C#.
We are running SQL Server 2000.
Thanks in advance,
BettinaSQL Server's T-SQL language doesn't have any in-built features that can
perform any kind of http calls - soap or otherwise.
T-SQL does provide ability to call external libraries and operating system
commands via things such as sp_OACreate (COM) and xp_cmdshell (console
commands), so it's arguable that your could conceivably call a web-service
from within the Query Analyser, consume it with sp_xml_preparedocument etc
but this is really getting into the zen mastery area & not really what Query
Analyser was designed to perform.
You might do better writing a VBScript or JScript & running that as a DTS
package, or perhaps just coding something in a VS.Net project (with
whatever's your favourite language flavour..)
Regards,
Greg Linwood
SQL Server MVP
"bpdee" <anonymous@.discussions.microsoft.com> wrote in message
news:cb4301c3ef43$84912d60$a101280a@.phx.gbl...
> I've made a database change to a table to add home and
> operational amounts. In an upgrade path, I need to
> populate these columns with values. There is already C#
> code that does the currency conversion based on comparing
> transactional currency to both the home and operational
> currency codes. Right now, our upgrade scripts are run
> via Query Analyzer. Is there a way for me to call web
> services and execute methods that have already been
> written to do the currency conversion for me? I'd hate to
> reinvent the wheel and rewrite code for something that's
> already been in done C#.
> We are running SQL Server 2000.
> Thanks in advance,
> Bettina
>|||Hi Greg,
Thank you so much for your response. Unfortunately, I'm
not a database programmer (I only have experience as an
Oracle Forms programmer) and I am not knowledgeable in
creating VBScripts, JScript, or writing something up using
VS .NET. I was hoping to find an easier answer.
Thanks again for your response.
Bettina

>--Original Message--
>SQL Server's T-SQL language doesn't have any in-built
features that can
>perform any kind of http calls - soap or otherwise.
>T-SQL does provide ability to call external libraries and
operating system
>commands via things such as sp_OACreate (COM) and
xp_cmdshell (console
>commands), so it's arguable that your could conceivably
call a web-service
>from within the Query Analyser, consume it with
sp_xml_preparedocument etc
>but this is really getting into the zen mastery area &
not really what Query
>Analyser was designed to perform.
>You might do better writing a VBScript or JScript &
running that as a DTS
>package, or perhaps just coding something in a VS.Net
project (with
>whatever's your favourite language flavour..)
>Regards,
>Greg Linwood
>SQL Server MVP
>"bpdee" <anonymous@.discussions.microsoft.com> wrote in
message
>news:cb4301c3ef43$84912d60$a101280a@.phx.gbl...
comparing
to
>
>.
>|||Sorry there's not an easier answer.. :c/
This (xml, soap etc) is an area where things are improving in SQL Server but
for now it's not a simple task to perform in QA & is better suited to
language development..
Regards,
Greg Linwood
SQL Server MVP
"bpdee" <anonymous@.discussions.microsoft.com> wrote in message
news:d76901c3ef5c$3bad51f0$a401280a@.phx.gbl...
> Hi Greg,
> Thank you so much for your response. Unfortunately, I'm
> not a database programmer (I only have experience as an
> Oracle Forms programmer) and I am not knowledgeable in
> creating VBScripts, JScript, or writing something up using
> VS .NET. I was hoping to find an easier answer.
> Thanks again for your response.
> Bettina
>
> features that can
> operating system
> xp_cmdshell (console
> call a web-service
> sp_xml_preparedocument etc
> not really what Query
> running that as a DTS
> project (with
> message
> comparing
> to

No comments:

Post a Comment