I think SQL server adds them to enforce the order of operations (that my guess anyway). The query was probably tested in either 2005 or 2008 Enterprise manager or whatever they call it now. I have noticed that Query Analyzer will rewrite your queries when you run them. I wish there was a way to shut that off.
-----Original Message----- From: Bryan Stevenson [mailto:[email protected]] Sent: Monday, October 18, 2010 4:36 PM To: cf-talk Subject: Re: What difference does the parenthesis make? I'd second a double check of caching....and I'd restart the CF services between changes and test again. I mention the latter because every once in a while CF just doesn't "see" changes at all or correctly. It's like it's not seeing the cource has changed and is not re-compiling. Anyways...that is one thing I always consider when queries are involved and I know the code should work or behave differently. Cheers On Mon, 2010-10-18 at 16:03 -0400, Les Mizzell wrote: > On 10/18/2010 3:33 PM, Michael Grant wrote: > > > > In this case specifically the parenthesis should make no difference at all. > > Are you sure the two queries are exactly as you've shown them? > > Yup. > > Database is SQL Server > > I can run the query with the paranths, and get the expected results. > Edit the same page to remove them, no results. > > I can also substitute the variable "#law.paid#" with a known ID integer, > and get the same results. > > paID=<cfqueryparam value="45" cfsqltype="cf_sql_integer" /> > > Weird... > > SELECT nl_id > FROM vw_newsletters > WHERE > (paID=<cfqueryparam value="#law.paid#" cfsqltype="cf_sql_integer" />) > AND (nl_status = 'published' OR nl_status = 'archived') > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338306 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

