Error: Process ID %d is not an active process ID 
Author Message
 Error: Process ID %d is not an active process ID

Hi All,

I'm runing stored procedure that contains the following:
---------------------------------------------------------------------------

begin
      declare spid_cursor cursor scroll for

      open spid_cursor


      begin



      end

      close spid_cursor
      deallocate spid_cursor
 end

---------------------------------------------------------------------------
It works good usually, but once in a while I get the following error:
"Process ID %d is not an active process ID."

Any idea what wrong? or what is the meaning of this error?

Thanks in advanced,
-Tomer



Fri, 13 May 2005 19:49:35 GMT
 Error: Process ID %d is not an active process ID

Tomer,

What this code tries to do is disconnect all the active processes from the
database before it detaches it (you can't detach a database with active
connections). What might cause the error is between the time that the cursor
is created and the process is killed using the 'kill' statement, it is
already killed in another way (for example bu the user who started the
connection).

If you use SQL Server 2000 there is a lot easier way to achieve the goal of



IMMEDIATE'

You can find more inforamtion about ALTER DATABASE and its options in BOL.

hth

Jacco


Quote:
> Hi All,

> I'm runing stored procedure that contains the following:
> --------------------------------------------------------------------------
-

> begin
>       declare spid_cursor cursor scroll for

>       open spid_cursor


>       begin



>       end

>       close spid_cursor
>       deallocate spid_cursor
>  end

> --------------------------------------------------------------------------
-
> It works good usually, but once in a while I get the following error:
> "Process ID %d is not an active process ID."

> Any idea what wrong? or what is the meaning of this error?

> Thanks in advanced,
> -Tomer



Fri, 13 May 2005 20:06:42 GMT
 Error: Process ID %d is not an active process ID
Thanks a lot!


Quote:
> Tomer,

> What this code tries to do is disconnect all the active processes from the
> database before it detaches it (you can't detach a database with active
> connections). What might cause the error is between the time that the
cursor
> is created and the process is killed using the 'kill' statement, it is
> already killed in another way (for example bu the user who started the
> connection).

> If you use SQL Server 2000 there is a lot easier way to achieve the goal
of
> this stored procedure, simply replace everything before exec sp_detach_db



> IMMEDIATE'

> You can find more inforamtion about ALTER DATABASE and its options in BOL.

> hth

> Jacco



> > Hi All,

> > I'm runing stored procedure that contains the following:

> --------------------------------------------------------------------------
> -

> > begin
> >       declare spid_cursor cursor scroll for

> >       open spid_cursor


> >       begin



> >       end

> >       close spid_cursor
> >       deallocate spid_cursor
> >  end

> --------------------------------------------------------------------------
> -
> > It works good usually, but once in a while I get the following error:
> > "Process ID %d is not an active process ID."

> > Any idea what wrong? or what is the meaning of this error?

> > Thanks in advanced,
> > -Tomer



Fri, 13 May 2005 20:53:38 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Msg 6106,Process ID %d is not an active process ID.

2. Msg 6106,Sev 16: Process ID 67 is not an active process ID.

3. Linking Unix Process Id's back to Session Id's

4. Query to tie Rollback to Session ID/Process ID

5. Process ID 216:1112 owns resources that are blocking processes on Scheduler

6. Error Message Process ID 66

7. Error Process ID

8. show ado con respective sql2000 process id

9. bad process ID (SPID)

10. Process Id 0

11. Process ID

12. BUG : SqlDumpExceptionHandler Process %id generated fatal exception c0000005


 
Powered by phpBB® Forum Software