Link to home
Start Free TrialLog in
Avatar of jsuanque
jsuanqueFlag for Australia

asked on

SQLCMD syntax encounters "unexpected argument.Enter'-?'

Hello Experts,
Got stucked on this issue. I just wanted to run a stored procedure through command line\prompt but unfortunately i'm getting this persistent error

Sqlcmd: 'MyProc"': Unexpected argument. Enter '-?' for help.

Here is my line...
 sqlcmd -S Svr1\Inst1 -d MyDB -Q "EXEC MyProc"

MyProc exists on the specified Server\Instance db and could run it via SQL Analyzer but when i run it via command line i'm encountering the error.
Is there something wrong in my Syntax? Or is there special permission required to run my SP?
Any suggestion is appreciated.
Avatar of jsuanque
jsuanque
Flag of Australia image

ASKER

Please don't bother...I guess the problem is that the whole syntax was copied froma wordpad and the fouble quote created from wordpad doesn't work when you paste it in the command line.
ASKER CERTIFIED SOLUTION
Avatar of jsuanque
jsuanque
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Problem was just due to the method of applying the command rather than issue with syntax as initially thought of.