Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import a flat file in T-SQL

Status
Not open for further replies.

VeryGoodGirl

Programmer
May 9, 2007
7
US
I am trying to import a very 'messy' flat file into SQL SERVER 2000 via T-SQL. It is a screen dump. I do not know the record delimintors but think that the lines are 160 characters long. I do not see were the BULK INSERT command lets you specify a line length.

Thank you.

 
If you don't know the record delimiters then how do you expect to get it into a database server?

What are the end results you are looking for after you get this into sql server? Are you just looking to store it?



____________ signature below ______________
You are a amateur developer until you realize all your code sucks.
Jeff Atwood

 
I know that the line length is 160. Plan to bring each line in as a record and then parse fields.
 
Suggest you use DTS instead of Bulk insert. It can bring in fixed length files and let you set where the fields break onthe line as part of the process.

"NOTHING is more important in a database than integrity." ESquared
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top