DECLARE @idoc int
DECLARE @doc1 varchar(8000)
DECLARE @doc2 varchar(8000)
SELECT @doc1 = SUBSTRING(name, ( 0*8000 ) + 1, 8000 ) ,--from aaaa where bbbb = 'dhsghg'
@doc2 = SUBSTRING(name, ( 1*8000 ) + 1, 8000 ) from aaaa where bbbb = 'dhsghg'


EXEC sp_xml_preparedocument @idoc OUTPUT, @doc1

/* Step1 */

SELECT *
FROM OPENXML (@idoc, '/aaaa/bbbb/cccc/dddd/eee',1)


With ([name] varchar(50) '../@name',
number varchar(50) '../@number')

EXEC sp_xml_preparedocument @idoc OUTPUT, @doc2

/* Step2 */

SELECT *
FROM OPENXML (@idoc, '/aaaa/bbbb/cccc/dddd/eee',1)


With ([name] varchar(50) '../@name',
number varchar(50) '../@number')



I am parsing an xml file which is having more than 8000 characters. So I am selecting the file into two variables of varchar datatype each with 8kb size.
And doing the abobe two steps,step1 and step2.

How can i combine these two steps into a single step. I am expecting something like following.


EXEC sp_xml_preparedocument @idoc OUTPUT, @doc1+@doc2

Thanks.