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

Posted on 2011-05-12
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

    Author Comment

    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

    soultion was to retype all in the command line rather than copy and pasting it

    Author Closing Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
    Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    761 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

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now