I have run the bcp command in query window to generate the tsv file. In between I cancelled the query. I tried to kill the SPID. But it is killed/rollback.
I tried to delete the tsv file in server. It is throwing error as ‘the file cant be deleted because it is open in bcp.exe’. please assist to resolve
The easiest way is to restart the machine however that can’t be recommended since it is a server and not PC. I would suggest to find the process in the task manager in the process tab and look for anything starting with or similar to BCP and you can do “End Process” or if that doesn’t work then “End Process Tree”. Once you killed this process, file would be released and will be ready for any I/O operation.
Please let us know in case this helps.