I
iporter
In the following code, the two Response.Write statements output exactly
the same - I can copy and paste both into Query Analyzer, and run them
fine. However, if I comment out line 3, the assignment of "SELECT
T..." to the variable query, the last line produces the error:
Line 1: Incorrect syntax near '<'.
Many thanks in advance for any explanation - the problem is tearing my
hair out!!
Iain
CODE:
---------------
var query = unprocessedRuleHTML.substring(ruleIndex.length,
(unprocessedRuleHTML.length - "</DIV>".length));
Response.Write("**" + query + "**<br /><br />");
query = "SELECT TOP 5 CI_MI.CI_ID, MI_ID, MI.url, CI.content, title,
AccessibilityTitle, MI.LongTitle, extension FROM ContentItems CI LEFT
JOIN CI_MI ON CI_MI.CI_ID = CI.ID LEFT JOIN MenuItems MI ON CI_MI.MI_ID
= MI.ID LEFT JOIN CF_CI ON CI.ID = CF_CI.CI_ID LEFT JOIN ContentFormats
CF ON CF_CI.CF_ID = CF.ID LEFT JOIN CI_T ON CI.ID = CI_T.CI_ID LEFT
JOIN Tags T ON CI_T.T_ID = T.ID WHERE tag = 'crop protection'";
Response.Write("**" + query + "**<br /><br />");
var tempData = executeRS(query);
the same - I can copy and paste both into Query Analyzer, and run them
fine. However, if I comment out line 3, the assignment of "SELECT
T..." to the variable query, the last line produces the error:
Line 1: Incorrect syntax near '<'.
Many thanks in advance for any explanation - the problem is tearing my
hair out!!
Iain
CODE:
---------------
var query = unprocessedRuleHTML.substring(ruleIndex.length,
(unprocessedRuleHTML.length - "</DIV>".length));
Response.Write("**" + query + "**<br /><br />");
query = "SELECT TOP 5 CI_MI.CI_ID, MI_ID, MI.url, CI.content, title,
AccessibilityTitle, MI.LongTitle, extension FROM ContentItems CI LEFT
JOIN CI_MI ON CI_MI.CI_ID = CI.ID LEFT JOIN MenuItems MI ON CI_MI.MI_ID
= MI.ID LEFT JOIN CF_CI ON CI.ID = CF_CI.CI_ID LEFT JOIN ContentFormats
CF ON CF_CI.CF_ID = CF.ID LEFT JOIN CI_T ON CI.ID = CI_T.CI_ID LEFT
JOIN Tags T ON CI_T.T_ID = T.ID WHERE tag = 'crop protection'";
Response.Write("**" + query + "**<br /><br />");
var tempData = executeRS(query);