SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On



Export Data in Text File Using BCP Expand / Collapse
Author
Message
Posted Friday, February 06, 2009 2:43 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, December 09, 2009 1:56 AM
Points: 544, Visits: 49
Comments posted to this topic are about the item Export Data in Text File Using BCP
Post #651467
Posted Wednesday, February 11, 2009 1:03 PM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Today @ 11:52 AM
Points: 668, Visits: 1,339
Good article. One suggestion would be to use the pipe character ( | ) as the default separator. Some people and place names have embedded commas. Some countries use commas as decimal separators.

Keep up the good work. Nice job.


ATB

Charles Kincaid

Post #655181
Posted Wednesday, February 11, 2009 4:09 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, February 24, 2010 11:45 AM
Points: 55, Visits: 2,246
Thanks for the quick and simple overview of how to use BCP with xp_cmdshell from within an SP.
Question: Are there any options to delimit text values? I'd like to use BCP to produce 'csv' files, however some of my data has commas and line-feeds/carriage-returns in it: I'd need to double-quote data those values...
Thanks,
Mark


Mark
Just a cog in the wheel.
Post #655312
Posted Sunday, February 15, 2009 10:56 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, December 09, 2009 1:56 AM
Points: 544, Visits: 49
Hi Mark,
There is no option available in bcp to delimit the some field value into double-quote but you can you double-quote for all the field values.

Thanks
Manish Mathur
Post #657486
Posted Monday, February 16, 2009 1:16 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, February 24, 2010 11:45 AM
Points: 55, Visits: 2,246
manish.mathur (2/15/2009)
Hi Mark,
There is no option available in bcp to delimit the some field value into double-quote but you can you double-quote for all the field values.

Thanks
Manish Mathur


Yeah, that's what I thought.. Oh well.

Thanks for the reply!!

Mark


Mark
Just a cog in the wheel.
Post #658046
Posted Wednesday, August 05, 2009 10:59 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, February 23, 2010 5:45 AM
Points: 3, Visits: 31
I am running the procedure and getting error:
SQLState = S0002, NativeError = 208
Error = [Microsoft][SQL Native Client][SQL Server]Invalid object name 'EMS.dbo.tblBilling'.
SQLState = 37000, NativeError = 8180
Error = [Microsoft][SQL Native Client][SQL Server]Statement(s) could not be prepared.

Please guide
Regards:
Abdul Rahman
Post #765955
Posted Tuesday, August 11, 2009 9:42 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 20, 2009 10:22 AM
Points: 3, Visits: 8

There is no option available in bcp to delimit the some field value into double-quote but you can you double-quote for all the field values.


Hi There, in your post you mentioned that there is a way to double quote all fields in BCP, could you tell me how to achieve this please, as I am struggling to find anywhere that tells me.

cheers
Post #768739
« Prev Topic | Next Topic »


Permissions Expand / Collapse