|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Tuesday, June 19, 2012 10:53 PM
Points: 544,
Visits: 62
|
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 9:18 AM
Points: 772,
Visits: 1,825
|
|
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
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, April 16, 2013 11:16 AM
Points: 103,
Visits: 2,395
|
|
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.
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Tuesday, June 19, 2012 10:53 PM
Points: 544,
Visits: 62
|
|
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
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, April 16, 2013 11:16 AM
Points: 103,
Visits: 2,395
|
|
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.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, April 11, 2013 1:35 AM
Points: 12,
Visits: 81
|
|
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
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, August 20, 2009 10:22 AM
Points: 19,
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
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Yesterday @ 6:30 AM
Points: 98,
Visits: 222
|
|
Apparently this sp depends on being able to remotely access SQL Server. As I'm running the express version it won't allow the connection. According to BOL neither will the Developer Edition http://support.microsoft.com/kb/914277
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Friday, May 03, 2013 2:29 PM
Points: 55,
Visits: 150
|
|
Good stuff, and timely for me since I've been working on moving 10GB of data to a remote location. After waiting 1.5 hours using an INSERT/SELECT I realized it wasn't going to work. I want this job to be automated on a daily basis and was wondering if you had a ready-made, magic script that would import the txt file into another database on the other end?
Wallace Houston Sunnyland Farms, Inc.
"We must endeavor to persevere."
|
|
|
|