I am using SQLCMD to try and connect to an SQL Server to run a script. Running this script fails with an error. This is the command I run:
SQLCMD -b -S AGAPI-PC\WORKSTATION -d Asp_TestDatabase1231 -u Test -p SQL -i "C:\WorkArea\INSTALL\INSTALL\bin\Debug\Data\SQL\Install\Asp.sql" -o "C:\WorkArea\INSTALL\INSTALL\bin\Debug\Data\Logs\SQLScriptResults_Asp.sql.log"
This is the error returned:
Sqlcmd: 'Test': Unexpected argument. Enter '-?' for help.
I have tried a number of things including the following:
Hopefully someone has come across this before that may be able to shed some light.
As Damien_The_Unbeliever stated:
Arguments are case sensitive. -u (unicode output) != -U.(login id)
This is also backed up by Microsoft's documentation on SQLCMD here: https://msdn.microsoft.com/en-us/library/ms162773.aspx
Upon replacing the -u switch with -U the SQLCMD command worked without any issues.