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

Importing .txt to SQL 2000

2
I receive a .txt sales report each month from our retailers with the following format…

A[Customer Name] [Customer ID] [Customer Address] [Customer Phone]
L[Customer ID] [Quantity] [UPC Number]
L[Customer ID] [Quantity] [UPC Number]
...
A[Customer Name] [Customer ID] [Customer Address] [Customer Phone]
L[Customer ID] [Quantity] [UPC Number]
L[Customer ID] [Quantity] [UPC Number]
...

I get one file per retailer per month, so each file would be its own import/batch.

I am trying to import these files into SQL 2000 and populate 3 tables; batch, customer and line-item. However, since there is no delimiter (the fields are defined by char length), I do not know how to parse out the data. I also do not know how to separate the file into the different tables.

Any help would be greatly appreciated.

Thanks
Jun 8 '09 #1
3 1561
ck9663
2,878 Expert 2GB
Use format file in BCP. For more of format file, read this

Happy coding!

-- CK
Jun 9 '09 #2
KevinS
2
OK, I see how BCP can be a HUGE help to me on this, thanks. However, I do not see how BCP can separate the customer data line from the following line items.

If I am not mistaken, BCP assumes the entire file is essentially a single table, which my files are not.

Thanks again!!
Jun 9 '09 #3
ck9663
2,878 Expert 2GB
Read the part about the -f switch.

It allows you to pass a format file. Format file can specify the structure of the file and table you are trying to upload.

Good luck.

--- CK
Jun 9 '09 #4

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

Similar topics

1
by: Matthias HALDIMANN | last post by:
When importing data into MS SQL Server 2000 from a MyODBC (v3.51) data source using Data Transformation Services, special characters like öäüéàè are not imported correctly. However, when the MyODBC...
2
by: Justin Allen | last post by:
SQL 2000, Windows 2000. I need to find a way to export our data from our production database and import it into a test database. I can do it to a freshly created test database I just have trouble...
1
by: Jeff Blumsom | last post by:
I recently changed for Access97 to Acces2000 and converted a significant application to 2000. I have been used to designing forms in a 'dummy' database and then importing them - with their code...
1
by: D Mat | last post by:
Hi, I'm trying to get MS Access 2000 to automatically import a series of (~200) flat text, tab delimited, data files into a single Access table, with consistent fields and rows. The files have...
5
by: dixie | last post by:
If I sent a user an empty database container - dB with no tables and I needed them to import their tables into it and one of their tables was a hidden table with the prefix Usys, is there any way...
3
by: Sam Alexander | last post by:
Hi Everone, I'm writing a script to import data from an XML file, and this tutorial is really an awesome guide : http://www.kbalertz.com/Q316005/Import.Server.Component.aspx ... problem though...
11
by: panic attack | last post by:
Hello everbody, Our system is using Sql Server 2000 on Windows XP / Windows 2000 We have a text file needs to be imported into Sql Server 2000 as a table. But we are facing a problem which is,...
0
by: Mike Collins | last post by:
I am importing a XML file and have not been having the best of luck in doing this, but I do have the following solution below. I will not be importing more than 2000 records at a time, but will be...
2
by: Mike Collins | last post by:
I am importing a XML file and have not been having the best of luck in doing this, but I do have the following solution below. I will not be importing more than 2000 records at a time, but will be...
1
by: thadson | last post by:
Hi, I'm trying to import specific cells from MS Excel 2000 spreadsheets to MS Access 2000 tables then move the spreadsheets to a different directory. I'm very new to this and I'm having trouble...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
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...

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.