[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Stored procedure return status question.

Posted on 2008-11-10
Medium Priority
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

Aneesh Retnakaran earned 1200 total points
ID: 22919984
in order to get the execution status do this

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

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

Assisted Solution

HuyBD earned 800 total points
ID: 22919995
please set nocount option


Open in new window


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

872 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