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 |
|
rdoghanna
Starting Member
6 Posts |
Posted - 2009-06-16 : 16:20:23
|
Please help! Lots looked at this yesterday - but no replies! ****I'm not sure where to begin with this project. I theoretically know what has to be done - and can write basic queries/updates to accomplish some of this but, my experience with complicated joins is limited. I would like to be able to put together a comprehensive process that would prevent missing anyone. I will be dealing with over 16k+ records. I have a test database to work with until it's functional and copies of real data in it. History: I have two databases/files - CT - current/active use (SQL 2005) Tables: CLIENTS(CLIENTID*, CLName, CFName, DOB) STORAGE(STORAGEID*, PURGEDATE, BOX, NOTES, CLIENTID(FK)) - EMPTY on all clientsCMHC - legacy data DOS System - export of data to Excel Spreadsheet - One Worksheet (CLIENTID, CLNAME, CLFNAME, DOB, PURGEDATE, BOX, NOTES)A conversion was done previously from the CMHC system in the CT system... but not all client information was transfered (based on constraints implemented at that time). Now we are using both systems to maintain information on storage of files and it's too time consuming. My company has asked me to take the CMHC legacy data for retention of records and import/append to the CT database so only one db is needed for future use. The caviat -- SOME of the clients may be in the CT database, while others may not. So, where CLIENTID exist in both systems, I need to just add information to the STORAGE table... where it is only in the CMHC I need to add the client info to both CLIENTS and STORAGE. The STORAGEID is an autonumber and will insert on Insert of data. Any help would be most greatly appreciated! |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2009-06-17 : 15:14:21
|
| Here is what I suggest you do. create a "staging" table in your CT sql server to import ALL CMHC data (from your spreadsheet). Then use sql code to fully populate 2 other staging table with the same structure as your CT tables. Once you have that we can help with statements to fill in the missing CT data based on comparing your CT staging tables with your real CT tables.Be One with the OptimizerTG |
 |
|
|
rdoghanna
Starting Member
6 Posts |
Posted - 2009-06-17 : 19:23:32
|
| I did that ... and was able to figure it out .. I think! :) Thank you very much! |
 |
|
|
|
|
|
|
|