Stored procedure return status question.

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.
heyday2004Asked:
Who is Participating?
 
Aneesh RetnakaranConnect With a Mentor Database AdministratorCommented:
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
0
 
HuyBDConnect With a Mentor Commented:
please set nocount option

....
AS
BEGIN
SET NOCOUNT ON 
...

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.