Assuming you are using MS SQL Server, you can use SCOPE_IDENTITY()
] to capture the auto generated ID.
Here is a sample
DECLARE @CustomerID INT
INSERT INTO Customer(Name, Email) VALUES ('Customer 1', 'firstname.lastname@example.org')
SELECT @CustomerID = SCOPE_IDENTITY()
Now you can use the "@CustomerID" variable to insert generated customer ID in another table.
Hope this helps.