Hi,
Well, yes, it doesn't really matter where you do the conversion.
select cast(scope_identity() as int) will do it on the server (note that
identity can go over int).
And yes, this is the best and correct way to retrieve the last inserted
identity field in the current transaction.

Signature
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com
> But is there a way in the sql statement forcing it to return integer? The
> identity value in the db is defined as int.
[quoted text clipped - 20 lines]
> > >
> > > Thanks