![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
The SP opens a cursor and loop a product table on a DB and generates the records that was read to other 3 tables on other DB... @iID=0 Loop "Select * from DB.Product" @iID = @iID + 1 Insert into otherDB.Product(ID,Description,otherfields...) values select @iID, description, ..., ... Insert into otherDB.ProductStock(ID,QttValue,otherfields...) values select @iID, description, ..., ... Insert into otherDB.AnotherTable(ID,otherfields...) values select @iID, etc, ..., ... Next I need the same ID for the record that will be inserted on the others tables... Is there other way instead using SP? Thanks MS SQL 2000 Hi |
![]() |
| Thread Tools | |
| Display Modes | |
| |