Forums

This topic is locked

Is there a limit to how long your SQL query can be

Posted 12 Dec 2006 00:18:26
1
has voted
12 Dec 2006 00:18:26 Mike Mitchell posted:
I have a fairly long SQL query that is valid (it runs in SQL Query Analyzer AND it will run in Dreamweaver 8 when I test it. But when I try to save it, it returns an error (which means I can't build a datagrid with it). The SQL is valid, but I'm wondering if it's just too long for DW to handle. With all the extra spaces removed, it's 755 characters long.

Here's the code, by the way.
<pre id=code><font face=courier size=2 id=code>
SELECT COUNT(*) AS Exp2, AnswerMarket_Chicago.AMmediaContent, DERIVEDTBL.AnswerOptionText AS Text1, DERIVEDTBL.AnswerID AS ID1,
DERIVEDTBL3.AnswerOptionText AS Text3, DERIVEDTBL3.AnswerID AS ID3
FROM (SELECT TOP 1 dbo.Answer.*
FROM dbo.Answer
WHERE Answer_QuestionID = 34) DERIVEDTBL CROSS JOIN
(SELECT TOP 1 dbo.Answer.*
FROM dbo.Answer
WHERE Answer_QuestionID = 34
ORDER BY AnswerID DESC) DERIVEDTBL3 CROSS JOIN
Question INNER JOIN
AnswerMarket_Chicago ON Question.Question_MediaTypeID = AnswerMarket_Chicago.AM_MediaTypeID
WHERE (Question.QuestionID = 34)
GROUP BY AnswerMarket_Chicago.AMID, AnswerMarket_Chicago.AMmediaContent, DERIVEDTBL.AnswerOptionText, DERIVEDTBL.AnswerID,
DERIVEDTBL3.AnswerOptionText, DERIVEDTBL3.AnswerID
ORDER BY AnswerMarket_Chicago.AMID
</font id=code></pre id=code>
If it's not the length, then what is it?

Reply to this topic