Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

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

 
   Database Forums (Home) -> Client RSS
Next:  Windows  
Author Message
tom178

External


Since: Jan 14, 2005
Posts: 2



(Msg. 1) Posted: Mon Jan 17, 2005 3:09 pm
Post subject: How to import fixed-width text file in MS SQL 2000?
Archived from groups: microsoft>public>sqlserver>clients (more info?)

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

 >> Stay informed about: How to import fixed-width text file in MS SQL 2000? 
Back to top
Login to vote
Dejan Sarka

External


Since: Mar 18, 2004
Posts: 317



(Msg. 2) Posted: Tue Jan 18, 2005 3:40 am
Post subject: Re: How to import fixed-width text file in MS SQL 2000? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 > 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
<a rel="nofollow" style='text-decoration: none;' href="http://www.SolidQualityLearning.com" target="_blank">www.SolidQualityLearning.com</a>

 >> Stay informed about: How to import fixed-width text file in MS SQL 2000? 
Back to top
Login to vote
Nigel Rivett1

External


Since: Nov 03, 2003
Posts: 37



(Msg. 3) Posted: Wed Jan 19, 2005 7:09 pm
Post subject: RE: How to import fixed-width text file in MS SQL 2000? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Bulk insert with a format file?
<a rel="nofollow" style='text-decoration: none;' href="http://www.mindsdoor.net/SQLTsql/BCP_quoted_CSV_Format_file.html" target="_blank">http://www.mindsdoor.net/SQLTsql/BCP_quoted_CSV_Format_file.html</a>

Bulk insert with a staging table?
<a rel="nofollow" style='text-decoration: none;' href="http://www.mindsdoor.net/SQLTsql/ImportTextFiles.html" target="_blank">http://www.mindsdoor.net/SQLTsql/ImportTextFiles.html</a>

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
<a rel="nofollow" style='text-decoration: none;' href="http://www.mindsdoor.net/SQLTsql/MoveImportData.html" target="_blank">http://www.mindsdoor.net/SQLTsql/MoveImportData.html</a>


"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
 >
 >
 >
 >> Stay informed about: How to import fixed-width text file in MS SQL 2000? 
Back to top
Login to vote
Sundeep

External


Since: Mar 20, 2009
Posts: 1



(Msg. 4) Posted: Fri Mar 20, 2009 10:25 am
Post subject: RE: How to import fixed-width text file(ragged right) in MS SQL 2005? C#.net handcode [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

i don't want any wizard system plz.. ,file has to be imported by a user which has always same format so i need to do coding for that in C#.net(type of software)

no bulkinsert can't i have string to string copy


From http://www.developmentnow.com/g/98_2005_1_0_0_386543/How-to-import-fix...width-t

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com/g/
 >> Stay informed about: How to import fixed-width text file in MS SQL 2000? 
Back to top
Login to vote
Ilya Margolin

External


Since: Mar 20, 2009
Posts: 1



(Msg. 5) Posted: Fri Mar 20, 2009 1:01 pm
Post subject: Re: How to import fixed-width text file(ragged right) in MS SQL 2005? C#.net handcode [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Sundeep,

There are many ways to skin a cat. One of them executing command-line BCP
utility (http://msdn.microsoft.com/en-us/library/ms162802.aspx) from .net.
This is the fastest. Another is reading a file line by line in .net, parsing
it by character positions and writing to a table. There is also SSIS
approach.

Ilya


"Sundeep" wrote in message

>i don't want any wizard system plz.. ,file has to be imported by a user
>which has always same format so i need to do coding for that in C#.net(type
>of software)
>
> no bulkinsert can't i have string to string copy
>
>
> From
> http://www.developmentnow.com/g/98_2005_1_0_0_386543/How-to-import-fix...width-t
>
> Posted via DevelopmentNow.com Groups
> http://www.developmentnow.com/g/
 >> Stay informed about: How to import fixed-width text file in MS SQL 2000? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Export/Import - Hi, We are using SQL server at Factory and HeadOffice and both are not linked, We want to send some data from HO to Factory's Sql server and vice versa through CD/Floppy. How to do this ?. (Export/Import) . Can be do this using programming? Please reply...

Import & Export in SQL 2005 - I want to import and export data in SQL Server 2005, how can I do through in Microsoft Sql Server Management Studio.. Thanks

[SQL2005] equivalent to the SQL 2000 taskpad view in Manag.. - Hello, I just installed SQL 2005, and I am looking for the information about my file usage, as I was able to see in the taskpad view with SQL 2000. Could you help me on this please ? Thanks in advance, Regards, Vincent

How to add RESTORE permission to Sql server 2000 & 2005 us.. - How to add RESTORE permission to Sql server 2000 & 2005 users. I need to add only Restore permission to the existing user. *** Sent via Developersdex http://www.developersdex.com ***

How to install SQLserver 2005 in windowXP with SQLserver 2.. - Hello: I have a trouble on installing sqlserver 2005 on window xp which has sqlserver 2000 client. I would like sqlserver 2000 client and sqlserver 2005 Management Studio coexit together. However, I always got the error: Installatioin of sql server..
   Database Forums (Home) -> Client All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]