Title: Message
Hi,
 
I have a strange problem....I've been moving our code from SQL Server to Sybase and I have encountered the following problem....
 
In one of my insert statements...the SELECT @@IDENTITY returns 0 instead of the desired value....
 
example....
 
<insert id="insertSample"
          parameterClass="SampleClass">
    <![CDATA[      
    INSERT INTO sample_t(
      col1
    , col2
    , col3
    ) VALUES (
      #val1#
     ,#val2#
     ,#val3#
    )
    ]]>
  <selectKey resultClass="int" keyProperty="id" >
      SELECT @@IDENTITY AS value
  </selectKey>  
  </insert>
 
However, I've been running some unit tests and I have found a nearly identical statement elsewhere which returns a correct value (using Sybase)...
 
I'm baffled....Everything used to work just fine under SQL Server....
 
Mat 

Reply via email to