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 |
drtduarte
Starting Member
12 Posts |
Posted - 2009-10-26 : 11:00:39
|
Dear Friends,I need to update all rows from column vendor from an sql database, I have the updated data on excel file, here you have the example:Excel Data:ID Vendor1 20 2 143 104 21SQL Data:ID Vendor1 22 103 454 60Can this be done with an sql statment?Regards,David |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-10-26 : 12:10:38
|
I'd import the excel sheet into SQL 1st, then update table.UPDATE tSET Vendor = xl.vendorFROM yourTable tJOIN importedExcelTable xlOn xl.id = t.id |
 |
|
gangadhara.ms
Aged Yak Warrior
549 Posts |
Posted - 2009-10-26 : 23:02:30
|
Hi,You can import the data to SQL by using a wizard to a temp table from there u can use the update statement to update all the records by using the join. |
 |
|
|
|
|