I have need to produce a merged table from a table and a spreadsheet
The table that contains all the matches for a package – “ad_group_to_package”
It has a large number of other fields as you can see from the example – spreadsheet attached - “Decisionmapping _logic”
All fields are nvarchar
We now have a spreadsheet that has been worked on manually – that shows many packages by
Packagename, AD group & the Actual target package that needs to be matched against the ‘packagename’
This is cleaned and more accurate match to the packages found.
The target_package column is definitive as its been manually decided its the best match.
The spreadsheet needs to be matched against the table to find all the packages that match and mark them to use the defined ‘target package’ and not the other versions that maybe in the table under the same group.
The ad group has many occurrences of the package name with all the errors you get with a direct data import.
We need to use the spreadsheet to create a new table that has only the matches between the spreadsheet and table “ad group to package”
I need a complete solution please
The table ad group to package is small as is the spreadsheet,”decisionmapping_logic”
Im open to how it should be done -
I can bulk insert the spreadsheet as tab delimited file into to a table if that helps the merging and joins – so we can assume Decisionmapping_logic could be a raw table.
Final result :
We would be left with a merged table that included all the records from “Ad group to package” table – but where there were multiple matches for a packagename all point to one correct ‘Target package’
The merged table should have a field that recorded the correct TargetPackage – from decisionMapping_logic
Also if possible it would be useful to have a new flag column introduced that could be marked as true when there are many packages and they have been matched to 1 ‘target package’ in new table.
This column could be called ‘targetPackage_flag’
I need a complete solution please with all sql working and not just suggestions.
SQL 2005 server version
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
-Mike Kapnisakis, Warner Bros
With your subscription - you'll gain access to our exclusive IT community of thousands of IT pros. You'll also be able to connect with highly specified Experts to get personalized solutions to your troubleshooting & research questions. It’s like crowd-sourced consulting.
We can't always guarantee that the perfect solution to your specific problem will be waiting for you. If you ask your own question - our Certified Experts will team up with you to help you get the answers you need.
Our certified Experts are CTOs, CISOs, and Technical Architects who answer questions, write articles, and produce videos on Experts Exchange. 99% of them have full time tech jobs - they volunteer their time to help other people in the technology industry learn and succeed.
We can't guarantee quick solutions - Experts Exchange isn't a help desk. We're a community of IT professionals committed to sharing knowledge. Our experts volunteer their time to help other people in the technology industry learn and succeed.