Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 18th, 2006, 06:11 AM
Authorized User
Join Date: Jul 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to import data from text file?

I have a text file. In which at the bottom of file, actual comma delimited data is present.
To insert data in table from mssql, i want to find starting position of text from file to start reading.
Is it possible to search text in text file from sql server 2000?
I have used bulk insert to import data from text file into temporary table. or is there any option in bulk insert in which i can specify starting positon (specific word). not row no.
But earlier i have format file with only required data.
Now i got file with some external information.
Is there any way to trim out external information.

Please help me out.
Thanks in advance.

Old September 18th, 2006, 06:56 AM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

I know of no way to set the cursor at a certain position to import the data into SQL; given this situation of the first part of the file was not necessary I would write a small application that would remove the leading data and leave just the comma delimited fields and then call a DTS process to insert the data.

--Stole this from a moderator

I will only tell you how to do it, not do it for you.

Unless, of course, you want to hire me to do work for you.

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i import a local text file into a jsp file ravibabu Java GUI 1 April 25th, 2007 04:05 AM
Text file import to data grid missing some values kf9thdon@aol.com ASP.NET 1.0 and 1.1 Basics 2 April 14th, 2006 10:42 AM
Apply Custom template & import data from text file shampabera Excel VBA 2 August 8th, 2005 07:41 AM
Best way to setup DTS text file import pjmair SQL Server DTS 7 September 20th, 2004 09:52 AM
import data from text file to excel(VBA) topr Excel VBA 2 August 26th, 2004 11:36 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.