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

Re: Error while using Scope_Identity() instead of @@identity. WHY? by Patrice

Patrice
Wed Jan 26 05:07:59 CST 2005

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

Patrice

--

<nashak@hotmail.com> a écrit dans le message de
news:1106680428.327717.215220@f14g2000cwb.googlegroups.com...
> 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
>