Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.4 KiB

  1. USE master
  2. GO
  3. /* Drop the database containing our sprocs */
  4. IF DB_ID('ASPState') IS NOT NULL BEGIN
  5. DROP DATABASE ASPState
  6. END
  7. GO
  8. /* Drop the obsolete startup enabler */
  9. DECLARE @PROCID int
  10. SET @PROCID = OBJECT_ID('EnableASPStateStartup')
  11. IF @PROCID IS NOT NULL AND OBJECTPROPERTY(@PROCID, 'IsProcedure') = 1 BEGIN
  12. DROP PROCEDURE EnableASPStateStartup
  13. END
  14. GO
  15. /* Drop the obsolete startup disabler */
  16. DECLARE @PROCID int
  17. SET @PROCID = OBJECT_ID('DisableASPStateStartup')
  18. IF @PROCID IS NOT NULL AND OBJECTPROPERTY(@PROCID, 'IsProcedure') = 1 BEGIN
  19. DROP PROCEDURE DisableASPStateStartup
  20. END
  21. GO
  22. /* Drop the ASPState_DeleteExpiredSessions_Job */
  23. DECLARE @JobID BINARY(16)
  24. SELECT @JobID = job_id
  25. FROM msdb.dbo.sysjobs
  26. WHERE (name = N'ASPState_Job_DeleteExpiredSessions')
  27. IF (@JobID IS NOT NULL)
  28. BEGIN
  29. -- Check if the job is a multi-server job
  30. IF (EXISTS (SELECT *
  31. FROM msdb.dbo.sysjobservers
  32. WHERE (job_id = @JobID) AND (server_id <> 0)))
  33. BEGIN
  34. -- There is, so abort the script
  35. RAISERROR (N'Unable to import job ''ASPState_Job_DeleteExpiredSessions'' since there is already a multi-server job with this name.', 16, 1)
  36. END
  37. ELSE
  38. -- Delete the [local] job
  39. EXECUTE msdb.dbo.sp_delete_job @job_name = N'ASPState_Job_DeleteExpiredSessions'
  40. END