If you are the sql instance administrator (since you are using SQLExpress, I'm sure you are trying to do this on your own computer, so there is a high chance that your user is the sql instance administrator), you should not use -E at all, just ignore it.
Secondly, specify the server, even if you are working with a local one.
Start with a simple sql command as shown below:
sqlcmd.exe -S "." -d MY_DATABASE -Q "SELECT * FROM MY_TABLE"
Replace MY_DATABASE and MY_TABLE with the name of your dbname and table. Make sure you can run it from the command line. It should return data from your table. (Optional command line options are case sensitive, so -s does not match -S)
Finally, do not try to pass parameters through the task scheduler. Put the command with all the parameters in the .bat file and just run the package from the task scheduler.
e-mre
source share