3
Answers

How do i update database table by exporting data from excel

Photo of Istudent Rana

Istudent Rana

7y
181
1
I have a table which already have data in it. 
I have a excel file which has updates list of data for the table.
 
I need to map the data in database table and i have to insert the rows which is not in database.
 
How do i do this operation
 
 

Answers (3)

1
Photo of Manish Kumar
NA 1.2k 4.5k 7y
Do following steps. (Assuming you are working on Sql Server)
--Import your excel data to sql server in a new table.
--Look for merege statement in sql server .Check below link
 
https://www.mssqltips.com/sqlservertip/1704/using-merge-in-sql-server-to-insert-update-and-delete-at-the-same-time/
 
Thanks,
Manish 
Accepted
0
Photo of Istudent Rana
NA 18 807 7y
I Know basic by using import export wizzard tools. But in my case i need to check up the column and data . If it already exists I want to run update query and if not then i want to insert. 
0
Photo of Sagar  Pandurang Kap
NA 2.7k 7.7k 7y
Hi,
 
For MySql follow below link :
https://dev.mysql.com/doc/mysql-for-excel/en/mysql-for-excel-export.html
 
For Sql Server follow below link :-
https://www.mssqltips.com/sqlservertip/1540/insert-update-or-delete-data-in-sql-server-from-excel/ 
 
Hope it helps