[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.0

Executing and Running a BCP Command

Asked by ron_finnerty in MS SQL Server

Tags: Microsoft, SQL Server, 2000

I'm trying to run execute a BCP command using a format file.  I have multiple clients that require data exported in comma delimited with double quotes around the fields in a .txt file.

So if you have a table with multiple records one for example
8455558888 John Doe John Doe 55 Anywhere St. Anywhere NY 00000

I need
"8455558888","John","Doe","John Doe","55 Anywhere St.","Anywhere","NY","00000"

The File Format I created for one particular Client is below
8.0
8
1      sqlchar      0      10      """\r\n"""      phone      SQL_Latin1_General_CI_AS
2      sqlchar      0      25      """\r\n"""      fname      SQL_Latin1_General_CI_AS
3      sqlchar      0      25      """\r\n"""      lname      SQL_Latin1_General_CI_AS
4      sqlchar      0      50      """\r\n"""      name      SQL_Latin1_General_CI_AS
5      sqlchar      0      50      """\r\n"""      address      SQL_Latin1_General_CI_AS
6      sqlchar      0      30      """\r\n"""      city      SQL_Latin1_General_CI_AS
7      sqlchar      0      2      """\r\n"""      state      SQL_Latin1_General_CI_AS
8      sqlchar      0      5      """\r\n"""      zip      SQL_Latin1_General_CI_AS

I saved this file as test.dat in the root of my c: drive.

I'm not sure if this is even the correct file format for achieving doulbe quotes around all fields.

Next I would like to execute this in Query Analyzer.  I believe you use the -f command to do this.
The code I'm working with is

exec master..xp_cmdshell 'bcp DBName..Table_Name OUT -f c:\test.dat e:\joe\examplel.txt -S imssql3 -t """,""" -c'

Any infomation that you could give would be helpful.
[+][-]02/21/08 09:37 AM, ID: 20949952Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/21/08 09:44 AM, ID: 20949989Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/21/08 09:53 AM, ID: 20950073Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/21/08 10:40 AM, ID: 20950533Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/21/08 10:44 AM, ID: 20950557Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/21/08 10:45 AM, ID: 20950570Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/21/08 10:47 AM, ID: 20950589Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/21/08 10:49 AM, ID: 20950604Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/21/08 11:02 AM, ID: 20950732Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/21/08 01:29 PM, ID: 20952049Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/21/08 01:37 PM, ID: 20952106Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/21/08 01:50 PM, ID: 20952216Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/21/08 01:59 PM, ID: 20952299Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/21/08 02:03 PM, ID: 20952340Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/22/08 05:54 AM, ID: 20957203Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/22/08 06:16 AM, ID: 20957440Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/22/08 06:54 AM, ID: 20957822Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/22/08 06:57 AM, ID: 20957867Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/22/08 09:44 AM, ID: 20959599Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/22/08 10:17 AM, ID: 20959874Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: MS SQL Server
Tags: Microsoft, SQL Server, 2000
Sign Up Now!
Solution Provided By: Zberteoc
Participating Experts: 3
Solution Grade: A
 
 
Loading Advertisement...
20091111-EE-VQP-89 / EE_QW_2_20070628