Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Multiple Records on Import

Status
Not open for further replies.

ScrewBalll

Programmer
Jan 14, 2005
18
GB
Hi there, I'm in dire need of some help regarding an import that I am carrying out.
The general idea is that I'm importing a price and a validity period into a table (pricing condition). If the validity period falls within another period then I want several records inputted to explain the behaviour.

Its probably best if I show you an example:

Data already in the table:
[Price1] [Price2] [ValidFrom] [ValidTo]
0 10 01/01/05 31/12/05

Incoming Data:-
[Price1] [Price2] [ValidFrom] [ValidTo]
20 0 01/02/05 15/02/05

I want this to map to:
[Price1] [Price2] [ValidFrom] [ValidTo]
0 £10 01/01/05 31/01/05
£20 £10 01/02/05 15/02/05
0 £10 16/02/05 31/12/05

You see how the dates have been updated and importing 1 record has update one record and created 2 more. This is a very simple example (for 1 item) but gives the basic idea (There will also be records in the database and multiple items coming in). I will be importing in the region of 10000 records and don't really want to think about using a cursor to filter through all the results.

If anyone has any ideas please help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top