Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 what's wrong? (jobs)

Author  Topic 

cube
Starting Member

1 Post

Posted - 2001-06-03 : 09:02:10
Sorry, I'm beginner, so, a question is:
I tryed to run the following code in MS SQL Server Query Analyser:

---------
USE db_users

IF EXISTS (SELECT * FROM sysobjects WHERE name='spStartSessionChecking' AND type='P')
DROP PROCEDURE spStartSessionChecking
GO

CREATE PROCEDURE spStartSessionChecking
AS
EXEC sp_add_job
@job_name='jbSessionChecking'

EXEC sp_add_jobstep
@job_name='jbSessionChecking',
@subsystem = 'TSQL',
@command = 'exec spCheckUsersSessions'

EXEC sp_add_jobschedule
@job_name='jbSessionChecking',
@freq_type = 4,
@freq_interval = 1,
@freq_subday_type = 0x4,
@freq_subday_interval = 10

GO

IF EXISTS (SELECT * FROM sysobjects WHERE name='spEndSessionChecking' AND type='P')
DROP PROCEDURE spEndSessionChecking
GO

CREATE PROCEDURE spEndSessionChecking
AS
EXEC sp_delete_job
@job_name='jbSessionChecking'

GO
-----------

So, returned errors:

Cannot add rows to sysdepends for the current stored procedure because it depends on the missing object 'sp_add_job'. The stored procedure will still be created.
Cannot add rows to sysdepends for the current stored procedure because it depends on the missing object 'sp_add_jobstep'. The stored procedure will still be created.
Cannot add rows to sysdepends for the current stored procedure because it depends on the missing object 'sp_add_jobschedule'. The stored procedure will still be created.
Cannot add rows to sysdepends for the current stored procedure because it depends on the missing object 'sp_delete_job'. The stored procedure will still be created.

What's wrong and how to do this correctly?
Thanks

   

- Advertisement -