I have 2 tables City_Locality and Country_State:
In Country_State table consisting of ID,Name,ParentID,HasState,Currency,IsActive,IsTopCountry.
In City_Locality table consisting of
ID,StateID,CountryID,Name,ParentID,DisplayOrder.IsActive,IsRequest,IsTopCity.I have a excel sheet(city.xlsx) having city_name,city_state.
I want to import data from excel sheet to database by using sql 2008. I have already state data is in the Country_State table. I have already some city data is in the City_Locality table.
I want a sql query to check duplicacy while insert the data in City_Locality table and what is the sql query to insert excel data into database??

Nitin SontakkeRank #264 · 9.6K reputationPosted Aug 31, 2016, 1:15 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 31, 2016, 1:18 AM EDT
Vinay SinghRank #604 · 4K reputationPosted Aug 31, 2016, 8:02 PM EDT
Country_State cs in cl.stateid=cs.stateidNitin SontakkeRank #264 · 9.6K reputationPosted Aug 31, 2016, 9:14 PM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 31, 2016, 11:26 PM EDT