Friday, March 9, 2012

Remote ForXML and XML Result

I created a sp_addlinkedserver to SQL 2005. I sent a
Remote For XML Request through a SP on SQL2005. However, I
now remember SQL Server does not send XML result back
because I found out what I got was a bunch
of "0x4409530068006900700070006500720049004400440B430 06F006
D00700..."
What options do I have?
"C TO" <anonymous@.discussions.microsoft.com> wrote in message
news:977101c478b7$e183dc40$a601280a@.phx.gbl...
[snip]
> What options do I have?
Put some kind of client in between.
Bryant
|||Bryant is right - SQL 2000 compatible FOR XML (top level with no TYPE
option) does not work directly between linked servers with either SQL 2000
or SQL 2005.
However, XML data type or NVARCHAR(MAX) will be fine when sent from a SQL
2005 linked server.
So, try using
FOR XML ..., TYPE --results in XML
or wrap SELECT ...FOR XML... into another SELECT:
SELECT (SELECT ... FOR XML...) -- results in NVARCHAR(MAX)
Regards,
Eugene
This posting is provided "AS IS" with no warranties, and
confers no rights.
"Bryant Likes" <bryant@.suespammers.org> wrote in message
news:etFf6gMeEHA.3632@.TK2MSFTNGP09.phx.gbl...
> "C TO" <anonymous@.discussions.microsoft.com> wrote in message
> news:977101c478b7$e183dc40$a601280a@.phx.gbl...
> [snip]
> Put some kind of client in between.
> --
> Bryant

No comments:

Post a Comment