Results 1 to 7 of 7

Thread: CSV from SQL

  1. #1
    Join Date
    Jan 2003
    Location
    california
    Posts
    21

    Question Unanswered: CSV from SQL

    Hi guys,

    I need to get a CSV(comma seperated file) generated for a table on MS SQL Server 2000 database.

    Can anyone help me! How should I solve this issue!



    Thanks a lot in advance
    Astha

  2. #2
    Join Date
    May 2003
    Posts
    2

    Arrow Re: CSV from SQL

    In sql query analyzer after getting the result, File -> save and change the following options
    Save as type ".CSV"
    Column delimiter as "Comma Separated (CSV)"

    Hope it solves your problem

    Originally posted by astha_raj
    Hi guys,

    I need to get a CSV(comma seperated file) generated for a table on MS SQL Server 2000 database.

    Can anyone help me! How should I solve this issue!



    Thanks a lot in advance
    Astha

  3. #3
    Join Date
    Jan 2003
    Location
    california
    Posts
    21

    Re: CSV from SQL

    Originally posted by abidulla
    In sql query analyzer after getting the result, File -> save and change the following options
    Save as type ".CSV"
    Column delimiter as "Comma Separated (CSV)"

    Hope it solves your problem
    Thanks for your help - But what I need to actually do is to generate the CSV file for the query result dynamically - Something by which I can create a file to run as a job to do the process automatically at regular intervals - as the table values changes frequently

    Can it be done programitacally some how - may be in Cold Fusion or something?

    Please guide me if you have any idea.

    Thanks anyways
    Astha

  4. #4
    Join Date
    Feb 2003
    Posts
    109

    BULK INSERT

    I know that you can use the BULK INSERT command to get CSV into a SQL Server table.

    I believe that it is just an argument in order to change from an import to an export.

    This BULK INSERT command is basically the same thing as BCP, if i understand it correctly..

    if this doesnt work, then you can just use BCP throgh the CLI and xp_cmdshell

    cheers and good luck
    Access 2002 ADP Rocks my World

    Long live SQL Server and 64bit Windows!!!

  5. #5
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    Use OSQL utility with -s option, refer to BOL for more information.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  6. #6
    Join Date
    Jan 2003
    Location
    california
    Posts
    21
    Originally posted by Satya
    Use OSQL utility with -s option, refer to BOL for more information.
    Thank you very much - I was able to do my stuff with bcp utility.

    Thanks again

    astha

  7. #7
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    I have used OSQL many times before to do so. Ofcourse BCP also does the thing.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •