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 |
|
dani2
Starting Member
32 Posts |
Posted - 2008-01-08 : 08:10:50
|
| Hi Is it possible to open and read a text (.csv) file and use the information to update a table, all this in a stored procedure?If so can you point me in the right direction?thank you |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-01-08 : 08:22:59
|
| Read about bulk insert in sql server help fileMadhivananFailing to plan is Planning to fail |
 |
|
|
dani2
Starting Member
32 Posts |
Posted - 2008-01-08 : 08:27:59
|
| But I want to perform only updates. Is there something like BULK UPDATE? :) |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-01-08 : 08:31:12
|
quote: Originally posted by dani2 But I want to perform only updates. Is there something like BULK UPDATE? :)
Insert into a staging table and update from that tableBulk insert to stage_tableUpdate Tset col1=S.col1,col2=S.col2,....from target_table T inner join Stage_table Son T.keycol=S.keycolDrop table Stage_tableMadhivananFailing to plan is Planning to fail |
 |
|
|
dani2
Starting Member
32 Posts |
Posted - 2008-01-08 : 08:35:13
|
quote: Originally posted by madhivananInsert into a staging table and update from that tableBulk insert to stage_tableUpdate Tset col1=S.col1,col2=S.col2,....from target_table T inner join Stage_table Son T.keycol=S.keycolDrop table Stage_tableMadhivananFailing to plan is Planning to fail
Good enough. Thanks! |
 |
|
|
|
|
|