【发布时间】:2015-12-13 13:17:48
【问题描述】:
在我的 ColdFusion 11 网站(使用 SQL Server 2008 R2)中,以下 cfquery 抛出上述错误:
<cfquery name="deleteGrantModificationItems" datasource="#dsource#">
DELETE col_key FROM myTable
WHERE col_key = <cfqueryPARAM value = "#appkey#" CFSQLType = "CF_SQL_VARCHAR">
</cfquery>
当我运行 sql profiler 来捕获查询时,我得到:
Declare @p1 int
Set @p1=NULL
exec sp_prepexec @p1 output,N'@P1 varchar(8000)',N'DELETE col_key FROM myTable
WHERE col_key = @P1 ','000000001644'
select @p1
当我在查询分析器中运行上述内容时,我收到以下错误:
Msg 208, Level 16, State 1, Line 1
Invalid object name 'col_key'.
Msg 8180, Level 16, State 1, Procedure sp_prepexec, Line 1
Statement(s) could not be prepared.
我一直无法找到错误的原因。
【问题讨论】:
标签: sql-server sql-server-2008 jdbc coldfusion jdbc-odbc