Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server DTS
|
SQL Server DTS Discussion specific to Data Transformation Service with SQL Server. General SQL Server discussions should use the general SQL Server forum. Readers of the book Professional SQL Server 2000 DTS with questions specific to that book should post in that book forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server DTS 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 January 27th, 2005, 06:45 AM
Authorized User
 
Join Date: Jan 2005
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hossrad
Default Help me on Fixed Field Length data files

Hi,
Does anybody knows how to import a fixed field length data file to a SQL Server table(from Query Analyzer!)??
I tried using "BULK INSERT" but it seems not to support fix length field data files.


God Bless you,
Hossein
__________________
Be Sure,
-hossrad
 
Old January 28th, 2005, 09:51 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

can you be more specific about the fixed length data type,
where is coming from (ascii,.txt, access, foxpro..etc)


Jaime E. Maccou
 
Old January 29th, 2005, 06:01 PM
Authorized User
 
Join Date: Jan 2005
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hossrad
Default

Hi,
I mean files with fixed field length like this :
1-ID 4 char
2-Name 15 char
3-FName 25 char
and so on ....
and they dont hava a delimeter like tab or comma or ...


God Bless you,
Hossein
 
Old January 29th, 2005, 07:50 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

using DTS make a transform task. You should know base on the start and finish of your file the file definition.
count beginning with your first column the number of characters from beginning to end, then start from the end of the first the beginning of the second and so on.

Right click on the file (source)properties and then select your delimiter (tab,:,; ",'|) and then transform your file to its destination. Since you said there is no delimiter in the original file you may have some additional clean up to do on the database table.

Jaime E. Maccou





Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting Row Colours dependant on a field- FIXED Andrew.Berry ASP.NET 2.0 Basics 6 December 13th, 2007 05:59 AM
write text file with fixed field length hugoscp Classic ASP Professional 0 June 27th, 2007 06:12 AM
Import Fixed length - SQL SERVER 2000 carumuga SQL Server 2000 4 December 23rd, 2006 10:18 AM
ADODB.Field error '800a0bcd' - FIXED buddyz Classic ASP Databases 2 October 9th, 2006 05:52 PM
generating a fixed length export file cooky4 VB Databases Basics 3 October 27th, 2003 03:42 PM





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