निम्न का प्रयास करें: Declare @xmldata xml set @xmldata = (select ... From test for xml...) select @xmldata as returnXml