Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Exporting Select statement values into csv with escape characters

Exporting Select statement values into csv with escape characters

Scheduled Pinned Locked Moved Database
help
2 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    indian143
    wrote on last edited by
    #1

    hi all, I am exporting record-set of select statement into a csv, but when I am doing it, if the fields already have values with , and then that comma is going into the csv as it is, and because of it the import is becoming tough, I want to have an escape for those comma which are coming from the field values. Any help would be grateful, thanks in advance friends. Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."

    V 1 Reply Last reply
    0
    • I indian143

      hi all, I am exporting record-set of select statement into a csv, but when I am doing it, if the fields already have values with , and then that comma is going into the csv as it is, and because of it the import is becoming tough, I want to have an escape for those comma which are coming from the field values. Any help would be grateful, thanks in advance friends. Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."

      V Offline
      V Offline
      Victor Nijegorodov
      wrote on last edited by
      #2

      You could use the BCP command with the -t option. See [bcp Utility](https://msdn.microsoft.com/nl-be/library/ms162802(v=sql.120).aspx) And there is a lot of other ways. Just google for something like MSSQL import into .csv

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups