[Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near '@P1'.
Posted on September 22, 2009 at 9:43 PM in ColdFusion
This is one of those posts that is definitely for my future reference. You know, one that I will hopefully never ever ever ever ever ever ever ever ever ever need, but will probably do the same stupid thing again anyways. Oh well, hopefully it will help someone else, too.
Run a query and get the following error message:
[Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near '@P1'.
The answer is ridiculously simple.
- WHERE foo IN <cfqueryparam
- cfsqltype="cf_sql_varchar"
- list="yes"
- value="value1,value2,value3" />
At a quick glance - OK, so I took about 80,000 quick glances - I didn't see anything wrong with that. Now what is pathetic is that I have been doing this for 12+ years and I know exactly what is wrong with that, but was in a hurry and didn't see it. Ugh.
Here's the correct code:
- WHERE foo IN (<cfqueryparam
- cfsqltype="cf_sql_varchar"
- list="yes"
- value="value1,value2,value3" />)
Perhaps you can spot it.
Latest Articles
- No recent entries.
Eventually something really brilliant and witty will appear right here.
Categories
- ColdBox (21) [RSS]
- ColdFusion (92) [RSS]
- Fusebox (3) [RSS]
- General (22) [RSS]
- jQuery (15) [RSS]
- Kalendar (1) [RSS]
- Linux (1) [RSS]
- Mura CMS (1) [RSS]
- Railo (1) [RSS]
- Rants (5) [RSS]
- Transfer (8) [RSS]
- Uni-Form Tag Library (36) [RSS]



On 9/22/09 at 11:29 PM, Don said:
On 1/11/10 at 6:27 PM, Victor said: