This might help you.
WITH BillingGroups AS(
SELECT BillingGroupNumber,
row_number() over (order by BillingGroupNumber) as RowNum
FROM Sap.DetailsImport
)
INSERT INTO [ReceiptRepository].[Lkup].[BillingGroups]
SELECT BillingGroupNumber,
'Company' + CAST(RowNum AS varchar(10)),
'Y',
'TeraByteMe',
GETDATE(),
TeraByteMe,
GETDATE(),
'2006-01-01 00:00:00.000',
'2020-12-31 00:00:00.000'
FROM BillingGroups
Now, this might give you repeated billing group numbers, I hope that you're aware of that.