Error while using Scope_Identity() instead of @@identity. WHY?

  • Thread starter Thread starter nashak
  • Start date Start date
N

nashak

Hello everyone,

I am trying to get back the primary key and was using @@identity
without any problem. However, when I use scope_identity() I get the
following error.


"Cast from type 'DBNull' to type 'Integer' is not valid."
Please help.


Thanks
 
Seeing some code may help. It looks like the value is not returned correctly
and is NULL instead of the expected value...

Patrice
 
Back
Top