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

import textfile into 2 tables in SQL server 2000

I have a text file with hundreds of records. each line contain 1250 values seperated by a semicolon. I have created 2 tables in SQL server 2000, one with 1000 columns & the second with 250 columns. my question is how can i import this textfile in to these 2 tables.and how i ensure that first 1000 values go to first table & the rest 250 in the next from each line of the text file. can be this be done via VB.NET or ASP? I would be grateful for your help. thanks.
Nov 11 '08 #1
5 3148
ck9663
2,878 Expert 2GB
Try uploading to a single table and split it once it's on the server.

-- CK
Nov 12 '08 #2
but sql server 2000 does not allow more than 1024 columns in 1 table, isnt it? isthere a way we can put 1250 columns in 1 table???
Nov 12 '08 #3
ck9663
2,878 Expert 2GB
That's a lot of columns.

Option 1:

Parse it on front-end and insert to table on the back-end

Option 2:

Upload the string as a single column (nvarchar(max))of a table, parse it in SQL Server to split into two tables.

-- CK
Nov 12 '08 #4
How do I parse it in SQL server if i import each line as a single column? Please can you provide a little with code .Many thanks.
Nov 12 '08 #5
ck9663
2,878 Expert 2GB
Option 1:

Use a lot of substrings.

Option 2:

Use cursor then tweak this code.

Option 3:

Use CTE


-- CK
Nov 12 '08 #6

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

Similar topics

3
by: Doug Baroter | last post by:
Hi, One of my clients has the following situation. They use Access DB for data update etc. some business functions while they also want to view the Access data quickly and more efficiently in...
1
by: Larry Rekow | last post by:
I have a report that's created each day as a flat textfile. Because I came from the Access world, I created a macro that imports it with a schema that gives meaningful names to the various...
0
by: Doug R | last post by:
Hello, I have a system that I am writing to automaticly import Credit Transaction data into a SQL Server 2000 Database. I am using a VB.Net application to detect when the file arives and prep...
3
by: Elaksomfan | last post by:
Hi, I am having trouble importing data from an excel spreadsheet into MS SQL Server 2000 using DTS Wizard. The DTS import process is successfull, no errors, but only 50 rows of approx. 1500 rows...
1
by: maflatoun | last post by:
Hi, In SQL 2000 if I wanted to take a complete copy of another running sql database all did was create a new database locally and right-click it and select import and point to another database...
1
by: Chicagoboy27 | last post by:
Is there a way to import multiple csv files from a directory into sql 2005? The situation I have right now is that I have a folder with multiple csv files that i need to import into sql 2005. I can...
1
by: joel.sjoo | last post by:
I'm a dba for SQL server and I Will import a textfile to SQL. For example I use a file with 3 columns. ID, Name and Surname and the columns are tab separated. I don't know much about programming....
1
by: tezza98 | last post by:
I need some help. Im using a dtsrun command to import 9 tables into an Access database, most of the tables have about 1000 rows, but one has 20000+ rows and grows everyday. Im Using Access 2003...
0
by: 123bargains | last post by:
Hello, I have a question on importing a database from MSSQL 2000 to MSSQL 2005. I hope someone on here can help me answer it. I am trying to import a database from MSSQL 2000 to 2005. But, when I...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.