DBL Quote Text Qualifier w/ BCP

  • Is there a switch to place dbl quotes around text using BCP? -JG


    -JG

  • do you mean add dbl quotes on an export?

    Steve Jones

    steve@dkranch.net

  • Yes, I was wanting to place dbl quotes around my text in the output of BCP.

    I have 45 tables I need to export to text. I looked at using DTS export wizard, but it would require me to perform that function 45 times, since I could not find a way to select all the tables to export at once. DTS export wizard adds dbl quotes around text. But I can not find the feature using BCP.

    Sorry about the dbl post. I could not delete it.


    -JG

  • I don't see a switch. It could be done in a query using queryout 'select "' + Fieldname + '", ...

    How badly do you need this and why?

  • Ok, so I was a bit lazy with the quotes. This actually works.

    declare @sql nvarchar(1000)

    set @sql = 'select ''"'' + cast(id as varchar(1000)) + ''"'', ''"'' + name + ''"'' from sysobjects'

    print @sql

    exec sp_executesql @sql

Viewing 5 posts - 1 through 4 (of 4 total)

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