I have 2 tables in the SQL 2000 database, Customers and CustomerAddress. The reason is because one customer can have multiple physical locations. I am building an ASP app that automates sales order process.
Anyway... I have a single form that has to create a new customer record but Company and Address are in different tables. When I do the first insert in automatically creates a new ID number for that customer but then I need to insert address info into Address table with that CustomerID that was just created. Basically I can't do both at once because I need to assign just created CustomerID to the FK field in the address table. Does it make sense ? ))
What's the best way to handle this ?
Anyway... I have a single form that has to create a new customer record but Company and Address are in different tables. When I do the first insert in automatically creates a new ID number for that customer but then I need to insert address info into Address table with that CustomerID that was just created. Basically I can't do both at once because I need to assign just created CustomerID to the FK field in the address table. Does it make sense ? ))
What's the best way to handle this ?