Subject: Merging Data
Posted By: Mitch Post Date: 1/2/2004 4:42:14 PM
Hello all, I am trying to merge two sets of data, that will, most likely, be done daily however, I am not sure how to do it.  It was suggested to me 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 (and 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.

I would also like to 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 central database where T_Tooling is located).   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.

Go to topic 8161

Return to index page 976
Return to index page 975
Return to index page 974
Return to index page 973
Return to index page 972
Return to index page 971
Return to index page 970
Return to index page 969
Return to index page 968
Return to index page 967