Click here to Skip to main content
15,920,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends,

I'm importing the excel sheet to database table,but in college details same college name is there but because of spaces & .(dots) ,its considering the new college name.
I don't want to insert duplicate colleges.
lease help me...
Posted

Hello,

Try trimming out the spaces (rtrim/ltrim)and replacing (the dot) the imported into a newer table.
See sample syntax below;

- import into a temp table; table 1
- clean (with trim and replace) and write to a new table with distict keyword to remove duplicates occurring.

SQL
select distinct replace(rtrim(ltrim(var1)),'.',''), other columns INTO Permanent_Table From Table 1


Hope this helps, good luck.

Ali J
 
Share this answer
 
v2
Put all distinct values from college names columns and insert proper name against it into new table. Then use that table to join with ur data and get the proper name.....In this way spelling mistakes can be covered....

Thanks
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900