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

x
?
Solved

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

Posted on 2011-05-12
4
Medium Priority
?
3,108 Views
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.
0
Comment
Question by:jsuanque
  • 3
3 Comments
 

Author Comment

by:jsuanque
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.
0
 

Accepted Solution

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

Author Closing Comment

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

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