Ask the Expert

Updating a table with a text file

I am a complete newbie in SQL Server 2000, and I would like to start by putting my applications Access mdb in adp by using SQL 2000. My first exercise was to import a .txt file in SQL. This text file is updated every day. I would like to know how to update my table most effectively: is it necessary to remove all the recordings with TRUNCATE and to import the new ones, or are there a series of orders which enable me to make an update of the changed recordings and to add the new ones? My question will undoubtedly seem you very simple.... be lenient: I debute.

    Requires Free Membership to View

Unfortunately, you would have to dump the entire table and then reimport the data. Since you are maintaining a text file, it doesn't have any capability to log the changes that were made so that you could apply just those changes. The easiest way would be to just truncate your table in SQL Server and then use BCP to reimport your text file.

 

For More Information

This was first published in April 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: