Executing set of SQL queries using batch file?

Save the commands in a .SQL file, ex: ClearTables.sql, say in your C:\temp folder. Contents of C:\Temp\ClearTables.sql Delete from TableA; Delete from TableB; Delete from TableC; Delete from TableD; Delete from TableE; Then use sqlcmd to execute it as follows. Since you said the database is remote, use the following syntax (after updating for your … Read more

Windows Kill Process By PORT Number [duplicate]

Solution 1: Kill Process Run command-line as an Administrator netstat -ano | findstr :<yourPortNumber> taskkill /PID <typeyourPIDhere> /F Solution 2: Change Port Please Make sure that new port you are going to set for your Application doesn’t listen to any other process Change the port server.port=8088 # Server HTTP port. Solution 3: Another way is … Read more

Does Windows batch support exception handling?

Windows batch scripting certainly does not have any formal exception handling – hardly surprising considering how primitive the language is. Never in my wildest dreams did I ever think effective exception handling could be hacked up. But then some amazing discoveries were made on a Russian site concerning the behavior of an erroneous GOTO statement … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)