Link to home
Start Free TrialLog in
Avatar of David
DavidFlag for United States of America

asked on

Is bcp asynchronous? isql fails (only) when run immediately after issuing bcp command

I have tried running a batch file which invokes first bcp to import data into a table, and then isql to process the data imported into the table.  The isql fails to do anything and there is also no error output.  But if I run the same isql command inside a different batch file a bit later, and separately from the first invocation, the processing is done correctly in that case.

Is there any possible negative interaction by running bcp then isql right after it inside a batch file, without delay in between?  If delay is needed, what is the best way to accomplish.  I have been spending hours trying to determine the cause of this problem.  I do not have easy access to error logs, since it is a shared hosting server, but probably I could get to them if that is truly important.
Avatar of nmcdermaid
nmcdermaid

Is the BCP inisde a batch file, and you are calling the batch file from inside another batch file?

If so you need to use the CALL command in your master batch file

Avatar of David

ASKER

The invocation of bcp and the invocation of isql follow each other, first bcp, then isql, inside the same batch file.  I am not sure the isql ever really fires, but when I run the same code in a batch file by itself, the isql works fine.  I was wondering if you are aware of any timing consideration e.g. the bcp is still running in the background, so the isql cannot be started.
ASKER CERTIFIED SOLUTION
Avatar of nmcdermaid
nmcdermaid

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial