Tuesday, March 20, 2012

Save the return value into a variable

Hi
How can I save the returned XML Expression into a variable? I tried to this
a described on the next line, but with no luck...
I use SQL Server 2000 SP 4
DECLARE @.doc nvarchar(4000)
SET @.doc = (SELECT * FROM sysdba.Account WHERE AccountID = 'ALFKI' FOR XML
auto)
Thank's
MichelHello Michel,
Can't be done in SQL Server 2000 since the XML Serialization is always done
post query there.
Thanks,
Kent Tegels
http://staff.develop.com/ktegels/|||If you have SQL Server 2005, the below query is valid. And you'lll have more
features in FOR XML.
"Michel" <michel_mueller@.bluewin.ch> wrote in message
news:ujy1pp69GHA.4708@.TK2MSFTNGP05.phx.gbl...
> Hi
> How can I save the returned XML Expression into a variable? I tried to
> this a described on the next line, but with no luck...
> I use SQL Server 2000 SP 4
> DECLARE @.doc nvarchar(4000)
> SET @.doc = (SELECT * FROM sysdba.Account WHERE AccountID = 'ALFKI' FOR XML
> auto)
> Thank's
> Michel
>

No comments:

Post a Comment