2013-09-30 45 views
0

我在SQL Server 2008安装中遇到此错误。我正试图将数据插入到特定的表中,并且出现此错误。隐式转换表单数据类型datetime到varbinary(max) - 无varbinary列

ERROR - JDBCExceptionReporter - Implicit conversion from data type datetime to varbinary(max) is not allowed. Use the CONVERT function to run this query.

只是要注意,我有没有变种二进制列的任何地方,我不知道为什么我得到这个问题的人有任何想法?

我没有SQL源代码,但我可以告诉你的Hibernate映射

<?xml version="1.0"?> 
<!DOCTYPE hibernate-mapping PUBLIC 
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> 
<hibernate-mapping> 
    <class name="tester.model.TellerTotal" table="TELLER_TOTAL"> 
     <id name="id" type="string"> 
      <column name="ID" not-null="true" length="32"></column> 
      <generator class="uuid.hex"></generator> 
     </id> 
     <version name="version" type="java.lang.Integer"> 
      <column name="VERSION" not-null="true" /> 
     </version> 
     <property name="del" type="java.lang.Integer"> 
      <column name="DEL" not-null="true" /> 
     </property> 
     <property name="txnType" type="java.lang.Integer"> 
      <column name="TRAN_TYPE" not-null="true" /> 
     </property> 
     <property name="txnRefNo" type="string"> 
      <column name="TRAN_REF_NO" not-null="false"/> 
     </property> 
     <many-to-one name="denomCcy" class="tester.model.Currency" fetch="select" insert="false" update="false" property-ref="cd"> 
      <column name="DENOM_CCY" /> 
     </many-to-one> 
     <property name="denomCcyCd" type="string"> 
      <column name="DENOM_CCY" not-null="true" length="10" /> 
     </property> 
     <property name="denom" type="java.math.BigDecimal"> 
      <column name="DENOM" not-null="true" length="19" /> 
     </property> 
     <property name="billType" type="java.lang.Integer"> 
      <column name="BILL_TYPE" not-null="true" /> 
     </property> 
     <property name="cashFlag" type="java.lang.Integer"> 
      <column name="CASH_FLAG" not-null="true" /> 
     </property> 
     <property name="totalDenomCnt" type="java.lang.Long"> 
      <column name="TOT_DENOM_CNT" not-null="true" /> 
     </property> 
     <many-to-one name="usr" class="tester.model.TestUsr" fetch="select" insert="false" update="false"> 
      <column name="USER_CD" not-null="false" length="32" /> 
     </many-to-one> 
     <property name="usrCd" type="string"> 
      <column name="USER_CD" length="32" not-null="false"/> 
     </property> 
     <property name="ecFlag" type="java.lang.Integer"> 
      <column name="EC_FLAG" not-null="true" /> 
     </property> 
     <many-to-one name="branch" class="tester.model.Branch" fetch="select" insert="false" update="false" property-ref="cd"> 
      <column name="BRANCH_CD" not-null="false" length="32" /> 
     </many-to-one> 
     <property name="branchCd" type="string"> 
      <column name="BRANCH_CD" length="32" not-null="false"/> 
     </property> 
     <property name="boxCd" type="string"> 
      <column name="BOX_CD" length="32" not-null="false"/> 
     </property> 
     <property name="tranDt" type="java.util.Date"> 
      <column name="TRAN_DT" not-null="false"/> 
     </property> 
     <property name="createDt" type="java.util.Date"> 
      <column name="CREATE_DT" not-null="false"/> 
     </property> 
    </class> 
</hibernate-mapping> 

Datbase结构

脚本使用:SELECT COLUMN_NAME , DATA_TYPE AS DataType FROM INFORMATION_SCHEMA.Columns where TABLE_NAME = 'TELLER_TOTAL' ;

COLUMN_NAME     DataType 
--------------    ----------- 
ID       varchar  
VERSION      int   
DEL       int   
TRAN_TYPE     int   
TRAN_REF_NO     varchar  
DENOM_CCY     varchar  
DENOM      money  
BILL_TYPE     int   
DR_FLAG      int   
CASH_FLAG     int   
TOT_DENOM_CNT    bigint  
USER_CD      varchar  
ec_flag      int   
branch_cd     varchar  
box_cd      varchar  
CREATE_DT     datetime 
TRAN_DT      datetime 
+1

显示您的代码(与SQL)。 – Dhwani

回答

0

对不起,打扰大家

原因是桌子上的触发器正在写到varbinary列

谢谢

相关问题