1

I just realized my caps was on from working in SQL Server, ha.

Anyways, Im trying to write from

serverName.databaseName.databaseInstanceName.TableName

to

C:\FileName.xml

using bcp and I want to write only columns Col1 and Col2, could I get a little syntax help? I'm struggling over here.

Thanks,

Ted

1
  • I did google it but my search terms were off... I got some better info this time. I'll post my result for future SO reference once ive got it working. Commented Sep 25, 2009 at 15:31

2 Answers 2

1

In order to create an XML version of the format file the command is identical except we use the -x parameter.

bcp "SELECT col1, col2 FROM AdventureWorks.HumanResources.Department" format nul -c -x -f department.xml -T -S servername
Sign up to request clarification or add additional context in comments.

Comments

1

FYI for anyone else....

bcp "Select whatever from dbInstanceName.dbo.tableName" quesryout C:\output.txt -e C:\errors.txt -c -T -S localhost\dbName

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.