![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi there, I want to import data file into SQL Server using the BCP command. Some of the data records already exist in the database. How can I make the BCP insert the new data into the database whilst discard the existing ones? Further more, how can I make BCP to perform followings. 1) for data not exist in the database, perform insert; 2) for data already exist in database, perform update. Many thanks. Jonathan *** Sent via Developersdex http://www.developersdex.com *** |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
You mean to write a program to check that? That would be disaster if we need to check the records one by one because we need to import over 400,000 records per day. Is there any parameter I can set for BCP command (or similar command) to perform that? It seems to me that the BCP would roll back all record on encountering a single error data item. That is actually not a good practice because the BCP can produce the error report to tell which record is wrong and why. Thanks. Jonathan *** Sent via Developersdex http://www.developersdex.com *** |
#5
| |||
| |||
|
#6
| |||
| |||
|
|
Hi Darren, Thanks. The tool I need is that it performs INSERT for new records and UPDATE for existing records (or skip over existing records). Yes, I can write a program to do that but the performance would be 1000% slower than BCP-level command. And, this is not difficult for BCP developers to have a option. Any advice? *** Sent via Developersdex http://www.developersdex.com *** |
![]() |
| Thread Tools | |
| Display Modes | |
| |