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 |
|
batarsehs
Starting Member
9 Posts |
Posted - 2005-06-20 : 12:22:43
|
| I have the following problem:I have the database on MS SQL database that has a table called "phones", which is the one that needs to be updated with the new phone numbers that I receive from clients every week. The different clients send me the data in different file formats, example, XML, CVS, Excel and Text. as well as different column "field" naming.I have an access database with a table for each client, where i import their files.for now, In order to update the MS SQL phones table, I would need to choose the exact columns that i need from each file, and then insert them into MS SQL. Therefore, i created an excel sheet where i paste all the colums needed from clients files, and then clean the spreadsheet for wrong phone number or null phone fields. Then i need to check that spreadsheet against the "phones" table in the MS SQL database for duplicate phone numbers, delete the duplicates and import the rest of phone numbers into the phones tableI am looking to make this process as automated as possible, especially the step of finding duplicate phone numbers in excel sheet that already exist in the MS SQL "phones" table.Can you help me out, please..... |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-06-20 : 12:56:24
|
| >>especially the step of finding duplicate phone numbers in excel sheet that already exist in the MS SQL "phones" tableHow about dumping all the numbers (including dupes) into a seperate sql server table. Then do a delete WHERE Exists statement. All remaining numbers can then be inserted.Be One with the OptimizerTG |
 |
|
|
batarsehs
Starting Member
9 Posts |
Posted - 2005-06-20 : 19:01:15
|
| Thanks for the reply... would it be possible to send me the SQL syntax that would accomplish deleting the dups and then inserting the rest of the data?I am also new to stored procedures, but would i be able to store such process as a procedure that i would execute everytime i need to? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|
|