【发布时间】:2013-04-03 12:36:06
【问题描述】:
考虑以下查询:
insert into dbo.SubscriptionDetails (taxonomyid)
values(select objectid from SubscriptionObjects where objectname=?)
此查询在我的本地环境中运行良好,但在执行生产环境时出现问题。
子选择查询是否需要在 SQL-Server 级别设置任何属性?
我使用 Java - JDBC 处理 SQL 事务。
查看下面的堆栈跟踪:
2013.03.28 15:42:11 CDT ERROR Error while inserting records into SubscriptionDetails table..
java.sql.BatchUpdateException: Subqueries are not allowed in this context. Only scalar expressions are allowed.
【问题讨论】:
标签: java sql-server sql-server-2008 jdbc