Monday, March 12, 2012

How to import fixed-width text file in MS SQL 2000?

Hello,
Is there a simple answer to this simple question?
How to import fixed-width text file?
I know the width of the columns but there are so many that I don't want
redefine them. I have already a table build for that data with the necessary
fields width. In dbase it was such a simple thing to do...
Note:
I went through the Import wizard in MS SQL 2000 and I could not find any
thing there about importing fixed-width text file.
Any help is greatly appreciated,
Les
> Note:
> I went through the Import wizard in MS SQL 2000 and I could not find any
> thing there about importing fixed-width text file.
The wizard does not have the option to use the Bulk Insert DTS task. The DTS
Bulk Insert task gives you graphical interface. Check it in Books OnLine if
it suits you.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
|||Bulk insert with a format file?
http://www.mindsdoor.net/SQLTsql/BCP...rmat_file.html
Bulk insert with a staging table?
http://www.mindsdoor.net/SQLTsql/ImportTextFiles.html
You can generate the format file for the first one or the inser statement in
the second from the structure of the destination table if you have set the
column sizes to match the file.
If you have a lot of different files consider holding the metadata in a table
http://www.mindsdoor.net/SQLTsql/MoveImportData.html
"Tom" wrote:

> Hello,
> Is there a simple answer to this simple question?
> How to import fixed-width text file?
> I know the width of the columns but there are so many that I don't want
> redefine them. I have already a table build for that data with the necessary
> fields width. In dbase it was such a simple thing to do...
> Note:
> I went through the Import wizard in MS SQL 2000 and I could not find any
> thing there about importing fixed-width text file.
>
> Any help is greatly appreciated,
> Les
>
>

No comments:

Post a Comment