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 |
|
velvettiger
Posting Yak Master
115 Posts |
Posted - 2008-07-10 : 14:43:27
|
| Hi Guys,I ran a query but only the old card numbers are coming up. I managed to locate a file which contains a list with the new cards and old cards.How would you replace the old cards with the new cards. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-10 : 14:54:23
|
EIther dump file data on to a staging table and do an update likeUPDATE tSET t.CardNumber=s.NewNumberFROM Table tINNER JOIN Staging sON t.CardNumber=s.OldNumber or use OPENROWSET to directly take it from file. |
 |
|
|
velvettiger
Posting Yak Master
115 Posts |
Posted - 2008-07-10 : 15:01:23
|
| When you say staging table you mean a temporary table? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-11 : 01:15:16
|
quote: Originally posted by velvettiger When you say staging table you mean a temporary table?
nope just create a new table and transfer data to it using DTS/SSIS.If you dont wish to create a table use OPENROWSET which takes fields directly from file. |
 |
|
|
|
|
|