It is not really clear what you're trying to accomplish, or why you're trying to accomplish it. A simple query to show what you've given here is:
SELECT ROW_NUMBER() OVER (ORDER BY AcctName), AcctName, AcctBegBal FROM A
But it is impossible to tell if this solves what you're actually asking. Look up BOL on ROW_NUMBER and IDENTITY columns for more information.