I need to return my result set in XML and this works fine, but if the number of records are increased, my xml output is truncated here is my query
truncated
Try the following:
Declare @xmldata xml set @xmldata = (select ... From test for xml...) select @xmldata as returnXml