|
Subject:
|
DTC or other way to merge data
|
|
Posted By:
|
Mitch
|
Post Date:
|
1/2/2004 4:37:14 PM
|
I am trying to merge two sets of data, that will, most likely, be done daily, but I am not sure how to do it. It was suggested that it be done with a DTC script (which I have never used before) or I was thinking of a stored procedure. I am not sure how to write either one.
Here is what I need to accomplish:
What I need is a way take any of the records in the IIM_NHOsetupSheets table that have a 6 digit, numeric only value in Iprod and concatenate the IDesc field (add a space) and the IDSCE field and write the result into the ToolDesc field of T_Tooling. Any records that exist in T_Tooling should be overwritten, any records that do not exist should be created.
It would be really cool if I could also generate a log file that reports changes performed, but not absolutely necessary.
I can either connect to the original table located in the Data Warehouse, or I can connect to an instance that could be kept current with a MS-DTC process that can be located within the PM-Data database. My data admin is pushing for the latter.
Table: IIM_nhosetupsheets
Fields: Name Type Length IPROD Char 15 IDESC Char 30 IDSCE Char 30 =============================== Table: T_Tooling
Fields: Name Type Length ToolID nvarchar 25 ToolDesc nvarchar 25 ================================
I have worked with stored procedures before, that use Case...When logic, but nothing that would be this complex I think.
Any help is welcome.
|
|