[Last Call] Learn how to a build a cloud-first strategyRegister Now


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

Posted on 2011-05-12
Medium Priority
Last Modified: 2012-05-11
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.
Question by:jsuanque
  • 3

Author Comment

ID: 35751941
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.

Accepted Solution

jsuanque earned 0 total points
ID: 35751950
soultion was to retype all in the command line rather than copy and pasting it

Author Closing Comment

ID: 35751957
Problem was just due to the method of applying the command rather than issue with syntax as initially thought of.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question