• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 609
  • Last Modified:

BCP command from batch file runs cithout stopping

The following is a BCP command in a Batch file I want to use to copy a SQL table to a CSV file:

bcp "livendb.dbo.zzz_VTE6" out "C:\users\FSAdmin\Documents\VTE6.csv" -c -t, -T -SHPC-DR1

When I run the batch file, it does not stop.

Can anyone see something wrong with the syntax?

I have something similar for a query which runs without a problem.

Thanks

Glen
0
GPSPOW
Asked:
GPSPOW
1 Solution
 
DcpKingCommented:
1. You don't need -t, as -c provides tab separation, and you didn't need a comma after it either.
2. What are you trying for with " -SHPC-DR1" ? Are you specifying that the database server is called "HPC-DR1" ?

Does this work for you (assuming you're on the same machine as the SQL Server instance)?

bcp "livendb.dbo.zzz_VTE6" out "C:\users\FSAdmin\Documents\VTE6.csv" -c -T

BTW, have you considered using SSIS? It could be a lot easier.

hth

Mike
0
 
GPSPOWAuthor Commented:
Thanks

I would love to use SSIS, but SQL Server does not have SSIS.

I got it to work with your suggestions.

glen
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now