SQLCMD not returning same results as SQL Management Studio

Posted on 2012-08-23
Last Modified: 2013-12-02
I have a question about the behaviour of SQLCMD vs the behaviour of the Management Studio's handling of the same operation.  In the Management Studio multiple executions of the indicated line in the attached File result in multiple lines of output showing:

(1 row(s) affected)

If SQLCMD is used to run the identical stored procedure, with the identical results occuring in the database, only the first running of EXEC (@FixInstruction) results in visible output, and subsequent executions result in the desired data changes, but no visible output.  Is there an option for SQLCMD which will correct this?

This is SQL Server 2005 (9.0.5057) running in Server 2008 SP2, with Management Studio 9.00.5000.00 and SQLCMD 9.00.5000.00 NT INTEL X86.

I would appreciate any suggestions.

Question by:VB6chuck
    LVL 5

    Accepted Solution

    It looks like this may be a known issue with sqlcmd.exe:

    Those are pretty weak workarounds, though.  Do you have a newer version of sqlcmd available for testing?  Best of luck!

    Author Comment

    It does look like a known issue.  I'm not allowed rights to install newer SQLCMD on the user's workstation, so I'll probably go with a small VB6 TSQL utility I've got already and see what results I get with it.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    This is my 3rd article on SCCM in recent weeks, the 1st ( dealing with installat…
    Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    760 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