#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Annapolis, MD
    Posts
    1
    Rep Power
    0

    Export Data to CSV from SQLServer tables


    I have a SQLServer table with names of 160 tables. I need to write a VBScript which will read this table, get the table names sequentially and export to CSV files. Can anyone provide me with a script?

    Thanks
  2. #2
  3. No Profile Picture
    Average Intelligence
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2003
    Location
    Ohio/Chicago
    Posts
    678
    Rep Power
    12
    I'm not going to write it for you, i'm sure it's out on the internet if you did a search, this is what you'd do though. (sudo code is free)

    query db, order by names (column you want sequentially)

    create fso object or however else you want to write to the file

    do a loop for each entry in the record set
    write column1 & "," & column2 & "," etc.... & vbcrlf
    loop

    close file

    that's it, you're done

IMN logo majestic logo threadwatch logo seochat tools logo