all groups > sql server programming > may 2006 >
You're in the

sql server programming

group:

assigning xml output


assigning xml output kishor
5/10/2006 11:17:02 PM
sql server programming:
I have a small question.
I am recently started using 2005 and I want to assign results of following
query in to a variable of any type.

select top 1 * from dbo.authors for xml auto


Please let me know how do I achieve this.

RE: assigning xml output Omnibuzz
5/10/2006 11:49:02 PM
try using for xml path()
--




[quoted text, click to view]
RE: assigning xml output Omnibuzz
5/11/2006 3:08:02 AM
and use it this way. Hope this helps.

declare @a varchar(8000)
set @a= (select top 1 * from dbo.Authors for xml path('AUTHORS') )
select @a
RE: assigning xml output kishor
5/11/2006 4:22:02 AM
Hi
I got error.

Line 2: Incorrect syntax near 'xml'.


Kishor

[quoted text, click to view]
RE: assigning xml output Omnibuzz
5/11/2006 4:27:01 AM
AddThis Social Bookmark Button