Import .csv file to SQL DB

  • I have a .csv file that dumpped from UNIX LDAP server. I tried to import it to SQL but could not implement that. When I create DTS package, it ask me for DSN source. But when I create a DSN, .csv file is not an option and gray out for the file name. I need a help on how to import .csv file to SQL DB. Thanks.

  • Is the .csv file located on the UNIX box after it is dumped? If so, you will need to ftp the file to the local host or a Windows server with a share then create a source file step to load the file into the DTS job.

  • Use DTS.  When creating a DSN use MS Excel for your provider.  It handles csv files nicely.



    A.J.
    DBA with an attitude

  • Only if you can get to the file from windows. Is the file on windows or UNIX?

  • I got the .csv file from UNIX through ftp. I also tried to use MS Excel for the provider on DSN, it could not accept the format.

  • Is it a valid .csv file? Have you opened it with a text editor or excel after you ftped it? try using a regular text file step and define it as an .csv file in the step.

  • It works fine with the regular text format on DTS. After rename to .csv file, it won't work.

    How to import binary file(got from UNIX through ftp) to SQL table, which provider should be?

  • Are you saying the text file step does not work after you change the extension?

  • It all works now. It was my mistake on the DSN creation. BTW, can FTP task be used to connect to UNIX servers on DTS? If so, what is the Directory Path should be on the bottom of FTP window?

  • Yes, it can be used to connect to an FTP server on UNIX. I believe you are talking about the destination path ,which has nothing to do with the FTP server.

  • Why DTS? Overkill for this.

    It's a simple CSV to just parse each row commas

    Just use BULK INSERT off an UNC path which solves any issues about ftp and file location, as long as righst are there.

    Unless I'm missing something... but K.I.S.S., no?

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply