Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 BCP utility - cannot stop a bcp command from running

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-03-15 : 07:53:40
Jennie writes "Hello there,

I created a bcp command to query for information from a few tables and output the resulting query set to a text file on my C:\drive.
I started running the bcp command and now I cannot stop it! It just runs and runs and runs. I have closed down my computer and opened the command prompt; entered bcp /? and the original command pops up and starts running endlessly again. Everytime I try to run another bcp command from the command prompt, the original bcp command starts running and it does not stop.

Ctrl + C does not stop it either. It seems as though the query/bcp command is cached somewhere but I don't know where, and I don't know how to clear it out so that the original bcp command stops running.

The bcp command was:

C:\>bcp "select database..table1.datetime_created, database..table2.description as CARRIER, database..table1.paper_manifest_id as MANIFEST_ID, database..table1.record_count as PARCEL_COUNT,
database..table.consignment_count as CONSIGNMENT_COUNT,
count(*) as PLPR_PARCEL_COUNT,
count(distinct UPI_UPI) as PLPR_CONSIGNMENT_COUNT, database..table1.id
from database..table1, database..table2, database..table 3
where database..table1.paper_manifest_id is not null
and (CAST(datepart(yyyy, database..table1.datetime_created) AS VARCHAR) + '/'+ CAST(datepart(mm, database..table1.datetime_created) AS VARCHAR) + '/'+ CAST(datepart(dd, database..table1.datetime_created)AS VARCHAR))= (CAST(datepart(yyyy, (getdate()-1)) AS VARCHAR) + '/'+ CAST(datep
art(mm, (getdate()-1)) AS VARCHAR) + '/'+ CAST(datepart(dd, (getdate()-1)) AS VARCHAR))
and database..table1.id= database..table3.pmc_id
and database..table1.paper_manifest_id = database..table3.paper_manifest_id
and database..table1.delivery_partner_id = database..table2.delivery_partner_id
group by database..table1.id,
database..table1.paper_manifest_id, database..table2.description, database..table1.datetime_created, database..table1.record_count, database..table1.consignment_count,
database..table1.delivery_partner_id"
queryout PaperManifest.txt -c -SSERVERNAME -Usa -P

In SQL server, this query returns six rows, and I expected it to do the same thing in the output text file when I ran the bcp command.

Please can you give me any ideas or advice to help me stop the bcp command from running so that I can use the bcp utility for other commands on my computer again!

Thanks so much.

Windows 2000 Professional, SQL Server 8.00.194"

nosepicker
Constraint Violating Yak Guru

366 Posts

Posted - 2005-03-15 : 17:07:45
Did you try ending the process in the task manager? Should show up as "bcp.exe" in the processes list.

Did you run the bcp from the command prompt or within a batch file? If you did it from the command prompt, I would try putting it in a batch or command file. You might be able to control it better from there.
Go to Top of Page
   

- Advertisement -