syntax near the keyword 'end'
Hello Guys,
Need Help!! I recently upgrade my CF server from 4.5 to 8.0. In Production enviornment every thing is running fine but in Pre-Production I am having issue running the same code. Provided I kept same setting please if some one can help me . When I am trying to run Webreports I get message on 8.0 server. Not sure what is going so wrong that it works fine on 4.5 server but not on 8.0 server.
| Page: | /webreports/LineSheetFind.cfm?RequestTimeout=500 |
| Date: | Fri Jul 10 09:52:07 EDT 2009 |
| Error: | Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer] Incorrect syntax near the keyword 'end'. |
Where Linesheetfind.cfm has :
<cfquery name="qrySelect" datasource="#local_session_var_sDSN_WebPDM#" timeout="150000">
#Replace(mySQL," ' ' "," ' ","ALL")# (NOTE: line28 and these are single quotes ( ' ' ) in double quotes ( " ") )
</cfquery>
My SQL Query is as follow:
SET nocount ON
SELECT DISTINCT FolderId
INTO #TEMP1_smehboob_29
FROM ((SELECT FolderHeaders.FolderId
FROM FolderHeaders
WHERE (FolderHeaders.Season IN (78) AND FolderHeaders.Generation IN (0, 2) AND FolderHeaders.Division3 IN (196)))
UNION
(SELECT FolderID
FROM FolderHeaders INNER JOIN
AuxiliaryFields ON AuxiliaryDefs.FieldNumber = AuxiliaryFields.FieldNumber AND
FolderHeaders.FolderId = AuxiliaryFields.PageId
WHERE AuxiliaryDefs.FieldLabel = ' Reporting Seasons ' AND (', ' + AuxiliaryFields.TextValue + ', ' LIKE ' %, Fall 2009, % ') AND
FolderHeaders.Generation IN (0, 2) AND FolderHeaders.Division3 IN (196))) AS x
SET nocount OFF
SELECT DISTINCT
FolderHeaders.FolderId AS FolderId, mAX(CASE WHEN AuxiliaryDefs.FieldLabel = ' Calendar : ' THEN isnull(AuxiliaryFields.TextValue, ' ')
ELSE ' ' END) AS OrderType, FolderHeaders.Style AS Style,
isnull(max(CASE WHEN AuxiliaryDefs.FieldLabel = ' Active : ' THEN CASE WHEN isnull(AuxiliaryFields.yesnovalue, - 2)
= 0 THEN ' Inactive ' ELSE CASE WHEN isnull(AuxiliaryFields.yesnovalue, - 2) = - 1 THEN ' Active ' ELSE ' Active ' END END END),
' Active ') AS Active
FROM (FolderHeaders INNER JOIN
(AuxiliaryDefs INNER JOIN
(Blocks INNER JOIN
AuxiliaryFields ON Blocks.BlockType = AuxiliaryFields.BlockType) ON (AuxiliaryDefs.BlockType = Blocks.BlockType) AND
(AuxiliaryDefs.FieldNumber = AuxiliaryFields.FieldNumber)) ON (FolderHeaders.FolderId = AuxiliaryFields.PageId) AND
(FolderHeaders.FolderId = Blocks.BlockId)) INNER JOIN
#TEMP1_smehboob_29 ON FolderHeaders.FolderId = #TEMP1_smehboob_29.FolderId
GROUP BY FolderHeaders.FolderId, FolderHeaders.Style
ORDER BY FolderHeaders.Style
SET nocount ON IF
(SELECT count(name)
FROM tempdb.dbo.sysobjects
WHERE name LIKE ' #TEMP1_smehboob_29 % ') > 0 DROP TABLE #TEMP1_smehboob_29 IF
(SELECT count(name)
FROM tempdb.dbo.sysobjects
WHERE name LIKE ' #TEMP2_smehboob_29 % ') > 0 DROP TABLE #TEMP2_smehboob_29 IF
(SELECT count(name)
FROM tempdb.dbo.sysobjects
WHERE name LIKE ' #TEMP3_smehboob_29 % ') > 0 DROP TABLE #TEMP3_smehboob_29 IF
(SELECT count(name)
FROM tempdb.dbo.sysobjects
WHERE name LIKE ' #TEMP4_smehboob_29 % ') > 0 DROP TABLE #TEMP4_smehboob_29 IF
(SELECT count(name)
FROM tempdb.dbo.sysobjects
WHERE name LIKE ' #TEMP5_smehboob_29 % ') > 0 DROP TABLE #TEMP5_smehboob_29 IF
(SELECT count(name)
FROM tempdb.dbo.sysobjects
WHERE name LIKE ' #TEMP6_smehboob_29 % ') > 0 DROP TABLE #TEMP6_smehboob_29 IF
(SELECT count(name)
FROM tempdb.dbo.sysobjects
WHERE name LK 7EO ' oF
