I have a SQL table with a compound key, ID (int, autogenerated) and TaxpayerID (varchar, user enters it). When the user registers, they enter a taxpayer ID & the taxpayer ID combined with the ID make a Primary Key.
Normally after entering a record, I'd return used @@Identity and return it to a Integer variable in my .NET application. However, it seems to be failing, I think because it is a compound key.
Is there a way to only return a PART of a compound primary key? (in this case, just the ID field)