I\'m using a stored procedure with this sql:
INSERT INTO [dbTblUsers]([strUsername], [strPassword]) VALUES (@p1,@p2); SELECT @@IDENTITY;
And ca
Firstly, don't use @@IDENTTY - use SCOPE_IDENTITY(); the first can give you unexpected answers if there are any triggers involved. Secondly; both of these return decimals; cast it at the call-site, IMO:
@@IDENTTY
SCOPE_IDENTITY()
SELECT CAST(SCOPE_IDENTITY() as int)