473,383 Members | 1,855 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Updating from a Text File?

Hi All,

I'm not that great with MS-SQL, as I never really have any occasion to
use it. However, I need to get this one thing working and don't have
a clue where to start.

I have a comma-delimited file that's delivered to the server every
night that contains updates to one of the tables. I'm trying to
create a DTS package that will read in the text file and update all of
the records contained in it, rather than simply append them to the
bottom of the table (resulting in duplicate entries).

I know how to schedule it and such, but if anyone can give me some
tips on the design of the DTS package, it would be much appreciated.

Thanks!

- Steve Osit
Jul 20 '05 #1
3 1393
S. Osit wrote:
Hi All,

I'm not that great with MS-SQL, as I never really have any occasion to
use it. However, I need to get this one thing working and don't have
a clue where to start.

I have a comma-delimited file that's delivered to the server every
night that contains updates to one of the tables. I'm trying to
create a DTS package that will read in the text file and update all of
the records contained in it, rather than simply append them to the
bottom of the table (resulting in duplicate entries).

I know how to schedule it and such, but if anyone can give me some
tips on the design of the DTS package, it would be much appreciated.

Thanks!

- Steve Osit


I've never attempted this myself but I know that BCP and Bulk insert may be
what you need.
I cannot give you any more clues than that as I have never had to look into
it myself but I'm sure if you search Google on BCP and bulk insert you will
find what you need.

Jayne
Jul 20 '05 #2
S. Osit (st*******@gmail.com) writes:
I'm not that great with MS-SQL, as I never really have any occasion to
use it. However, I need to get this one thing working and don't have
a clue where to start.

I have a comma-delimited file that's delivered to the server every
night that contains updates to one of the tables. I'm trying to
create a DTS package that will read in the text file and update all of
the records contained in it, rather than simply append them to the
bottom of the table (resulting in duplicate entries).

I know how to schedule it and such, but if anyone can give me some
tips on the design of the DTS package, it would be much appreciated.


I don't know DTS, so I can't help on that part. I would use BCP to load
the file into a staging table, and then update the target table from
there. Having some process read each row and then look it up in the target
table will not be effective.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #3
www.sqldts.com

Erland Sommarskog <es****@sommarskog.se> wrote in message news:<Xn*********************@127.0.0.1>...
S. Osit (st*******@gmail.com) writes:
I'm not that great with MS-SQL, as I never really have any occasion to
use it. However, I need to get this one thing working and don't have
a clue where to start.

I have a comma-delimited file that's delivered to the server every
night that contains updates to one of the tables. I'm trying to
create a DTS package that will read in the text file and update all of
the records contained in it, rather than simply append them to the
bottom of the table (resulting in duplicate entries).

I know how to schedule it and such, but if anyone can give me some
tips on the design of the DTS package, it would be much appreciated.


I don't know DTS, so I can't help on that part. I would use BCP to load
the file into a staging table, and then update the target table from
there. Having some process read each row and then look it up in the target
table will not be effective.

Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
1
by: Luis Esteban Valencia | last post by:
Hello Everyone, Iam an intermediate ASP.Net programmer and iam facing a challenging task. I have a table in MS-SQL server database called 'Members'. The table has following fields... ...
14
by: el_sid | last post by:
Our developers have experienced a problem with updating Web References in Visual Studio.NET 2003. Normally, when a web service class (.asmx) is created, updating the Web Reference will...
2
by: Alexey.Murin | last post by:
The application we are developing uses MS Access 2003 database (with help of ADO). We have noticed that during massive records updating the size of the mdb file increases dramatically (from 3-4 to...
0
by: Michael Kellogg | last post by:
I have a problem wherein a query that updates a GridView doesn't seem to really stay in sync with a label I have above the GridView. I have a GridView object that I'm updating with information...
5
by: CCLeasing | last post by:
Hello, I have searched google but can not find a straight forward answer to my problem. Hopefuly someone will be kind enough to offer their expertise. Please forgive if this seems a bit convoluted...
2
by: Jerry | last post by:
I am looping through a number of files and I want to display the current file name that is being processed to the form in a lable. this.lblProcessing.Text = "Processing file: " +...
3
by: slinky | last post by:
I have an aspx for with a textbox and a button. The goal is to simply have the user type a message, hit the button and it should append to the XML file. I can open the aspx in the browser with no...
4
by: directory | last post by:
hey guys, I've got a weird one for ya....i have a form which takes user input in the form of textbox's etc. It then grabs some details from a file and updates some of the labels with some info...
5
by: Bill Schanks | last post by:
I have a winform app (VB 2005) that allows users to export data to excel, make updates to the excel file and import the data from that Excel file and update the database. My question is: Is it...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.