Export Text file | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Export Text file

Hi All, I have text file with following structure(3col,muliple rows). emp_id fname minit
——— ——————– —–
A-C71970F Aria
A-R89858F Annette
AMD15433F Ann M
ARD36773F Anabela R
CFH28514M Carlos F
CGS88322F Carine G
DBT39435M Daniel B
DWR65030M Diego W
ENL44273F Elizabeth N
F-C16315M Francisco
GHT50241M Gary H
H-B39728F Helen
HAN90777M Helvetius A
HAS54740M Howard A But in my case i want to import this file to datbase table that table stucture should create automatically if I import the textfile.
Thanks & Regards
Mathivanan K
Great work may have to pass through these stages – ridicule, opposition, and then acceptance. Each man who thinks ahead of his time will probably be greatly misunderstood.- vivekananda
Hi Mathivanan, You can import the file to database using DTS. Open Enterprise Manager, go to tools then data transformation services and then Import. This is DTS wizard which helps to import/export data from one form to other. Regards
Sachin
ya i did the same, but i am getting sigle column , but i need 3 seperate coulumn like empid,fname,minit Thanks & Regards
Mathivanan K
Great work may have to pass through these stages – ridicule, opposition, and then acceptance. Each man who thinks ahead of his time will probably be greatly misunderstood.- vivekananda
I think you need to use proper delimiters in your text file.I tried to use your file.With tab as delimiter it creates a single column.To break up columns you need to use delimiters. cheers
Pali
Everything happens for your own good.

If there is no delimeter in the text file then the TAB will do the same, provided you check the columns definition when the DTS package is setup. Satya SKJ
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
]]>