I am relatively new when working with queries so let me apologize in advance. This is SQL Server 2012 that I will be working with. This data has been brought into a staging table through a nightly import from Excel. I need to move this data from this table into our main hardware table and make sure that I insert any new data while checking to make sure it updates any of the older data. I will give as much information as I can, please bear with me.
The field names are:
|Ticket_Num | Name | Worker | date1 | Serial | Part | Description1 | Type1 | Eqmt_Type |
I need to bring them into a table that has this:
|Event_NUM|Name|Install_Date|Pull_Date|Install_Tech|Pull_Tech| PMP1_Desc|PMP1_Part|PMP1_Serial|PMP2_Desc|PMP2_Part|PMP2_Serial|PMP3_Desc|PMP3_Part|PMP3_Serial|Motor1_Desc|Motor1_Serial|Motor1_Part|Motor2_Desc| Motor2_Serial| Cab1_Disc|Cab1_Part|Cab1_Serial|Cab2_Desc|Cab2_Part|Cab2_Serial|Dis1_Desc|Dis1_Part|Dis1_Serial|Dis2_Desc|Dis2_Part|Disc2_Serial|
Here is SQL Fiddle with an example of the data being pulled in from Excel: SQL Fiddle for data to be inserted
Here is SQL Fiddle with an example of what I would like: SQL Fiddle example of what I would like