Here is how I generate the error. I did it on purpose but still wondering why when SQLAzureMWBatchUpload runs into an error, it does not return to command prompt?
Is it by design?
Steps to get SQLAzureMWBatchUpload to hang.
- Run SQLAzureMW.exe
- Select Database, click Next
- Select any Database with tables that contain a key.
- select schema and tables
- Select 3 tables to create output for
After it creates the scripts, save the sql as Test.sql
sqlazuremwbatchupload -d false -o c:\temp\errorTest.txt -i C:\SQLAzureMW\test.sql
The first time it runs, it should work because the tables are empty
now run the command again and obviously it will error because you can't insert key values twice.
In the command prompt, if it errors, it would show the following error
5/29/2013 2:31:43 AM--> Error
SQLState = 23000, NativeError = 2627
Error = [Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of PRIMA
RY KEY constraint 'PK_CBAccountType'. Cannot insert duplicate key in object 'Sec
ured.CBAccountType'. The duplicate key value is (0).
SQLState = 01000, NativeError = 3621
Warning = [Microsoft][SQL Server Native Client 11.0][SQL Server]The statement ha
s been terminated.
BCP copy in failed
But it does not return to the command prompt >
How come it does not return to the command prompt? and is this by design?
I am asking because if I create a batch file with multiple sqlazuremwbatchupload in the file
if one fails, it will cause the others lines not to execute.