473,396 Members | 1,838 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,396 software developers and data experts.

Need to transfer many DBF files, while editing them at the same time

19
Alright, so here's my issue. I have a bunch of .dbf files, about 40 or so by summer's end, I'd say. These dbf files somewhat differ from each other as far as number of columns and data is concerned. I need to transfer all of these dbf files over to a SQL Server database so that I may write ASP pages for pulling statistics from them.

My problem is, this needs to be done in as easy a manner as possible, because we'll be getting more and more dbf files as we go along, and who knows what I'll be doing next summer when we'll probably get another 50 or so of these dbf files, so I can't upload them myself every time.

My idea is, I want to write an ASP page that scans a directory, checks for new dbf files (or changed dbf files, based on creation date), then reads all of the columns. If a specific column exists, the ASP page will do some extra stuff (see below) then upload to the SQL Server, if the column doesn't exist, it should just be a simple read and upload.

Now, if that specific column exists, what needs to be done is that each row must be checked, if data exists for that column, the entire row must be copied and re-inserted again with the data in that column replacing the data in another column. I hope that isn't too confusing.

Now here's my question, is this at all viable? Is it going to be quick and painless or will it take forever? Will I run into timeout issues?

Is ASP even the right language for me to be writing this in? I have experience with vb.net so I could write it in that if necessary.

I need this to be as easy and idiot-proof as possible, so that anyone can simply copy the dbf file to a specific folder, visit the index page of my stats web app for the files, and then simply wait for a short while as the new dbf file is processed and uploaded. Can this be done?

MGM out
Aug 6 '07 #1
6 2251
I don't get the idea exactly. You could mount the dbf's into sql server and then analyze it all there with some sp's. Thats an easier way I think.

I didn't get the thing about rewriting the record. Please provide more information
Aug 6 '07 #2
MGM
19
I don't get the idea exactly. You could mount the dbf's into sql server and then analyze it all there with some sp's. Thats an easier way I think.

I didn't get the thing about rewriting the record. Please provide more information
Basically, I have a table in the dbf with 3 columns. There's Column ID, Column A, and Column B. Column A is supposed to be there, and has X data. Column B is NOT supposed to be there, and has Y data. Now, each DBF file may or may not have Column B. If Column B DOESN'T exist, it's a simple matter of copying over the entire table to the SQL Server.

If Column B DOES exist, then we go through the entire table row by row. If the row has data (ie: Y data) in Column B, then we copy the entire row, give it a new ID, and replace whatever data was under Column A with Y data (the data that was under Column B), then remove Column B entirely.

I hope that explains it well...

Would it be fast if I first went though and checked for Column B, if it exists, to do the row adding as stated above, and THEN upload to SQL Server? Would I have to upload row by row or is there a quicker way?

MGM out
Aug 6 '07 #3
ck9663
2,878 Expert 2GB
Basically, I have a table in the dbf with 3 columns. There's Column ID, Column A, and Column B. Column A is supposed to be there, and has X data. Column B is NOT supposed to be there, and has Y data. Now, each DBF file may or may not have Column B. If Column B DOESN'T exist, it's a simple matter of copying over the entire table to the SQL Server.

If Column B DOES exist, then we go through the entire table row by row. If the row has data (ie: Y data) in Column B, then we copy the entire row, give it a new ID, and replace whatever data was under Column A with Y data (the data that was under Column B), then remove Column B entirely.

I hope that explains it well...

Would it be fast if I first went though and checked for Column B, if it exists, to do the row adding as stated above, and THEN upload to SQL Server? Would I have to upload row by row or is there a quicker way?

MGM out
how do you assign new ID?
Aug 7 '07 #4
I should use a temporary table ##table_name and insert there the A column, then the B column, truncate the original table and insert the data from the ##table_name back into the original table. (You will have to write a cursor to enforce the numbering)
Aug 7 '07 #5
MGM
19
how do you assign new ID?
I should use a temporary table ##table_name and insert there the A column, then the B column, truncate the original table and insert the data from the ##table_name back into the original table. (You will have to write a cursor to enforce the numbering)
I apologize, due to a case of misinformation among my fellow co-workers, I seem to have recieved the wrong information on this subject. Let me start over.

We have 4 columns. We have ColID, ColNameA, ColNameB, and ColQuantityA. Now, most dbf files won't have the ColQuantityA, in which case the entire table simply needs to be uploaded to SQL Server.

Some DBF files WILL have the ColQuantityA column. If it exists, what I need to do is to copy over what's in ColNameA into ColNameB to signify that more than one exists. That is to say, ColNameA represents, for example, a restaurant in a city. If the ColQuantityA column exists and there's a number more than 1, then that means more than one restaurant exists in that city. So what I need to do, is to copy the exact name over from ColNameA into ColNameB to show that more than one exists. ColID won't be edited as I stated before, it will always stay the same for that row, and no new rows will be added either.

I hope I wrote that clearly enough. With all that in mind, what would be the best way (ie: fastest, easiest) to upload the DBF files to SQL Server taking into account that many row edits may be needed for some DBF files.

MGM out
Aug 7 '07 #6
MGM
19
Has anyone come up with a solution yet? I would really like to get back to work on this project but cannot do so while this problem still exists...

MGM out
Aug 8 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Hal Vaughan | last post by:
I am writing out archive files using ZipOutputStream with the following code: aEntry is a global Array of ZipEntries llData is a LinkedList of the data corresponding to the the ZipEntry of the...
1
by: Jim | last post by:
Hi, Background: After a member registers, he's able to access and download any file available. We want to avoid the end user being able to distribute an URL to these files thereby making it...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
3
by: Shapper | last post by:
Hello, I am working on an ASP.NET/VB web site. I have several links including menu links. Considerer a want to load a page named page.aspx. I can do it using javascript. Or using this code:...
7
by: gaidar | last post by:
Hi, everybody, I'm just wondering if someone really need stuff like this: http://msdn2.microsoft.com/library/ms123401.aspx. If you answer yes than explain, please. Thanks! Gaidar
11
by: E.T. Grey | last post by:
Hi, I have an interesting problem. I have a (LARGE) set of historical data that I want to keep on a central server, as several separate files. I want a client process to be able to request the...
2
by: Bonzol | last post by:
vb.net 2003 Windows application We have a Client/Server system set up by communicating through a TCPClient object. The server loops continuously using a tcplistener device and each time a client...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
1
by: Alex | last post by:
Hello, I'm trying to write a little php script to transfert some files from a server to clients (web/http). It's working fin with small files. But transfering big files (try on 1Gb) failed!...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.