Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2001-10-15 : 17:44:44
|
| This will be an ongoing, repeat process that needs to be simplified as much as possible for a non-guru to run.I have an Excel Spreadsheet of data to Import into a table where the Primary Key is an IDENTITY field. For every row inserted into table 1, I need to insert a row into a join table that consists of the new ID from table 1 and a second field equal to a selected integer that will be constant for all rows inserted this run (but may change from run to run). I expect the spreadsheets to contain no more than 50 rows at a time.Here's a sample table structure:Events: EventID (Identity), Title, StartDate...EventXDept: EventID (FK), DeptID (FK)There are about a half-dozen data validation checks I need to make prior to inserting the data, with a means to either abort the process, or set aside rows that fail so they can be edited and re-run.I have used DTS to import data from Excel before, but not sure how to include the Insert into the second table, which needs the results of the IDENTITY field. Due to the need for a non-guru solution, I'm tempted to do the whole thing in a VB.exe, including individual inserts. Any better suggestions on how to do this?BTW: SQL 7, SP3 on NT4.-------------------------------------------------------------------Just because you CAN do something does not mean that you SHOULD!Edited by - AjarnMark on 10/15/2001 17:46:12 |
|
|
|
|
|