Click to See Complete Forum and Search --> : Scripting nested queries


SJ Smith
September 29th, 2005, 01:49 PM
I have a query similar to the following which I can run perfectly in SQL Query Analyser.

SELECT * FROM Client.dbo.Data1 WHERE APPLICATION_ID NOT IN (SELECT APPLICATION_ID FROM Client.dbo.Data2)

I need to put this query in a Javascript in DTS. When I run it I get the error "streaming not supported over multiple column result"

Do you know how I can do this as part of a java script. Is there a way I can perhaps do the query in two steps and use a tmeporary table? I tried the query rewritten to use joins rather than the nested select and I still get the same error.

Thanks,

SJ Smith
September 29th, 2005, 02:11 PM
This works if you add the FOR XML AUTO line to the end of the statement, I actually need the XML output anyway!!!

erickwidya
September 29th, 2005, 10:39 PM
try SELECT ... FOR XML AUTO, XMLDATA


FOR XML mode [, XMLDATA] [, ELEMENTS][, BINARY BASE64]

Arguments
XML mode

Specifies the XML mode. XML mode determines the shape of the resulting XML.
mode can be RAW, AUTO, or EXPLICIT.

XMLDATA

Specifies that an XML-Data schema should be returned. The schema is prepended to the document as an inline schema.

ELEMENTS

If the ELEMENTS option is specified, the columns are returned as subelements. Otherwise, they are mapped to XML attributes. This option is supported in AUTO mode only.

BINARY BASE64

If the BINARY Base64 option is specified, any binary data returned by the query is represented in base64-encoded format. To retrieve binary data using RAW and EXPLICIT mode, this option must be specified. In AUTO mode, binary data is returned as a reference by default.