I am updating queries to use the cfqueryparam after I was shown all the advantages to using cfqueryparam's. However I have now run into an error that I have not crossed before and not sure how to troubleshoot or where to look for the issue. I am guessing that it is a syntax issue. Here is the error-
Error Executing Database Query.[Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near '@P1'. The specific sequence of files included or processed is: C:\inetpub\wwwroot\cfleadsource\admin\MultipleAccountReassign_new.cfm, line: 170
Here is my query. As you can see the old query is commented out and has been replaced with the new query. It should be noted that the old query worked without issues and this is the first query on the page that has been altered. For the life of me I can not determine what is incorrect. Thanks for the help.
<cfquery name="GetAccounts" datasource="#dbConn#">
<!--- select top #callNum# * from contact where mar in (select mar from marselect where userid = #oUID# and mar not like '%branch%') order by newid() --->
select top <cfqueryparam value= "#callNum#" CFSQLType="CF_SQL_INTEGER"> * from contact where
mar in (select mar from marselect where userid = <cfqueryparam value= "#oUID#" CFSQLType="CF_SQL_INTEGER"> and mar not like '%branch%') order by newid()
</cfquery>