[Command] exit [(statement)] [Description] 
Lets you use the result of a SELECT statement as the return value from sqlcmd. The exit() statement with nothing between the parentheses executes everything preceding it in the batch, and then exits with no return value. You can also include the exit parameter as part of a batch file. For example: Copy sqlcmd /Q "exit(SELECT COUNT(*) FROM '%1')"