Wrox Programmer Forums
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 11th, 2007, 01:40 PM
Registered User
Join Date: Sep 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL Comment Error

I am running SQL Server 2005 SP2 and I am getting an SQL error due to the server not recognizing the "--" as a comment. (I am using the 32-bit version) The same code runs on SQL Server 2000 with no problem.

Is there a setting to correct this? Did I not install 2005 correctly? Do I need to install the cumulative update pkg 3 to correct this problem?

Here is the code:
<cfquery name="#attributes.output#" datasource="#request.dsn#">

            -- Retrive the product archive record
            select *
            from dbo.api_userArchive
            where isActive = 1

Here is the error msg:
Error Diagnostic Information

SQL operation unrecognized

The SQL operation you specified is unrecognized (only SELECT, INSERT, UPDATE, DELETE, and CALL are supported).

SQL = '-- Retrive the product archive record select * from dbo.api_userArchive where isActive = 1'

The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (27:3) to (27:65).

The error occurred while processing an element with a general identifier of (CFRETHROW), occupying document position (281:11) to (281:21).

Date/Time: 09/10/07 19:05:09
Browser: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)
Remote Address:

Old September 11th, 2007, 03:40 PM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

While I'm not familiar with how cold fusion works, it looks like it's stripping the hard returns from your cfquery element and possibly not finding any query to execute. However you said this works against SQL 2000? I can't see why they would behave differently.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Professional PHP5 Comment kcraft BOOK: Professional PHP 5 ISBN: 978-0-7645-7282-1 1 February 20th, 2005 10:19 PM
Removing comment coding Ray Pinnegar Access 2 November 15th, 2004 02:44 PM
Check comment or not Tachyophan Excel VBA 1 January 9th, 2004 06:20 PM
Help me about write a comment. fujinova JSP Basics 0 October 1st, 2003 08:22 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.