Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 text file import

Author  Topic 

vmtailor
Starting Member

4 Posts

Posted - 2005-03-02 : 18:24:09
Hi Guys!

I am a student, so very beginging level. as part of our assignment we have been asked to import the data from text file which got fillowing format. I don't know how to say the rows are seperated


-------------------------------------------------------------------------------------
| Emp# | Stud# | SIN | camp |
-------------------------------------------------------------------------------------
| 1 | 222333444 | 123-456-789 | SY |
-------------------------------------------------------------------------------------
| 2 | 777888999 | 323-434-343 | SY |
-------------------------------------------------------------------------------------


anybody can help.

Thank You

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2005-03-02 : 19:39:32
-------------------------------------------------------------------------------------
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-03-02 : 19:41:14
So what's the question?

Tara
Go to Top of Page

vmtailor
Starting Member

4 Posts

Posted - 2005-03-02 : 19:46:57
how to import using DTS what is the specification of the file
how to recognize the row and column? ignore ----- stuff
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-03-02 : 19:53:50
Are you sure that the file has a row separator and that it isn't just being displayed like that to show that the rows on separate lines? That is very, very unusual to have especially for a class assignment. Does your book give you any examples that have row separators? I'm thinking you can import the data into a stage table that has one column, then parse the table using T_SQL, but that isn't going to be easy for a beginner.

Tara
Go to Top of Page

vmtailor
Starting Member

4 Posts

Posted - 2005-03-02 : 20:03:18
yes, there is the row seperator .as we are importing other file which dosn't show this seperator.but say if we take out the row seperator can we import it?

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-03-02 : 20:05:57
Yes. Then you'd just need to tell DTS that the columns are separated by | marks.

Tara
Go to Top of Page

vmtailor
Starting Member

4 Posts

Posted - 2005-03-02 : 20:08:26
ok. i will try that in lab.
hope my teacher don't mind that.
Thank you
Go to Top of Page
   

- Advertisement -