I am running sqlcmd from a linux bash script. My target server is an Azure SQL. I execute an sql file with a lot of sql statements (around 2500). These are Insert/update/delete statements. I used the following command
sqlcmd -i $SQL_SCRIPT_FILE -m-1 -p
Initially there were individual sql statements in the file. When executing that, a lot of statements were being missed out (I found that by checking the database, as some of the insert statements does not reflect in db).
Then I put all the statements in try catch and transaction. I am writing the exceptions in an ErrorLog table. Now when I execute the file, nothing happen. I do not see any error in ErrorLog table, the sqlcmd output also not display anything specific. The output is:
(0 rows affected) Network packet size (bytes): 4096 1 xact[s]: Clock Time (ms.): total 23 avg 23.0 (43.5 xacts per sec.)