IF @@ROWCOUNT>0 AND @@ERROR=0 -- Checks if the last statement produced an error -- Selects the primay key value and the generated timestamp which is put back into the dataset SELECT @CustomerID = CustomerID, @Modified = Modified FROM Customer WHERE (CustomerID = SCOPE_IDENTITY()); RETURN

Now this is the LinqCode which you can call via LinqtoSQL context object