Stored procedure return status question.

Posted on 2008-11-10
Last Modified: 2012-05-05
I have a long stored procedure, inside this procedure, it created some temp tables and populate to a table with the data selected from these temp tables, and it will take several minutes to execute this procedure (to populate the table with the selected results takes that much time). Everything works fine except I want a return status to show the procedure is finished running (after several minutes). But when I execute the procedure, it just showed how many rows are updated, etc. there is no end of execution information when the procedure exits. Even when I add one line: print 'Done' at the end of the procedure, there is still no output 'Done' printed to screen at the end of running the procedure. Please advise. Thanks.
Question by:heyday2004
    LVL 75

    Accepted Solution

    in order to get the execution status do this

    Declare @Ret int
    Exec @Ret = urSpName <Parameters>
    SELECT @ret

    If the sp run successfully, the return value will be 0
    LVL 17

    Assisted Solution

    please set nocount option


    Open in new window


    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    SQl works but add Having  by null or value 11 37
    How to SUM hours for the same record 1 23
    SQL HELP 2 65
    SQL Server 2012 express 24 21
    by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
    When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    729 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

    19 Experts available now in Live!

    Get 1:1 Help Now