状况:插入表中有触发器,触发器中调用存储过程。

org.springframework.jdbc.UncategorizedSQLException: Error getting generated key or setting result to parameter object. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: The statement must be executed before any results can be obtained.
; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; The statement must be executed before any results can be obtained.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: The statement must be executed before any results can be obtained.

触发器没问题,Mapper配置也没问题,两边单独运行也没问题。

结论:SQLserver触发器和Mybatis的Mapper有冲突。

在触发器中添加语句

SET NOCOUNT ON
解决!

Error getting generated key or setting result to parameter object

相关文章:

  • 2021-06-22
  • 2021-08-10
  • 2021-09-22
  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
  • 2021-09-01
  • 2021-09-26
猜你喜欢
  • 2021-07-14
  • 2022-12-23
  • 2021-06-29
  • 2021-07-21
  • 2022-12-23
  • 2021-09-24
  • 2022-12-23
相关资源
相似解决方案