Home > Archive > MS SQL XML > October 2006 > Save the return value into a variable









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Save the return value into a variable
Michel

2006-10-25, 6:06 am

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


Kent Tegels

2006-10-25, 6:06 am

Hello 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/


Jinghao Liu

2006-10-25, 6:06 am

If you have SQL Server 2005, the below query is valid. And you'lll have more
features in FOR XML.

"Michel" < michel_mueller@bluew
in.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
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com