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.

64 lines
1.9 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 temporary tables */
  9. IF OBJECT_ID('tempdb..ASPStateTempSessions','U') IS NOT NULL BEGIN
  10. DROP TABLE tempdb..ASPStateTempSessions
  11. END
  12. GO
  13. IF OBJECT_ID('tempdb..ASPStateTempApplications','U') IS NOT NULL BEGIN
  14. DROP TABLE tempdb..ASPStateTempApplications
  15. END
  16. GO
  17. /* Drop the startup procedure */
  18. DECLARE @PROCID int
  19. SET @PROCID = OBJECT_ID('ASPState_Startup')
  20. IF @PROCID IS NOT NULL AND OBJECTPROPERTY(@PROCID, 'IsProcedure') = 1 BEGIN
  21. DROP PROCEDURE ASPState_Startup
  22. END
  23. GO
  24. /* Drop the obsolete startup enabler */
  25. DECLARE @PROCID int
  26. SET @PROCID = OBJECT_ID('EnableASPStateStartup')
  27. IF @PROCID IS NOT NULL AND OBJECTPROPERTY(@PROCID, 'IsProcedure') = 1 BEGIN
  28. DROP PROCEDURE EnableASPStateStartup
  29. END
  30. GO
  31. /* Drop the obsolete startup disabler */
  32. DECLARE @PROCID int
  33. SET @PROCID = OBJECT_ID('DisableASPStateStartup')
  34. IF @PROCID IS NOT NULL AND OBJECTPROPERTY(@PROCID, 'IsProcedure') = 1 BEGIN
  35. DROP PROCEDURE DisableASPStateStartup
  36. END
  37. GO
  38. /* Drop the ASPState_DeleteExpiredSessions_Job */
  39. DECLARE @JobID BINARY(16)
  40. SELECT @JobID = job_id
  41. FROM msdb.dbo.sysjobs
  42. WHERE (name = N'ASPState_Job_DeleteExpiredSessions')
  43. IF (@JobID IS NOT NULL)
  44. BEGIN
  45. -- Check if the job is a multi-server job
  46. IF (EXISTS (SELECT *
  47. FROM msdb.dbo.sysjobservers
  48. WHERE (job_id = @JobID) AND (server_id <> 0)))
  49. BEGIN
  50. -- There is, so abort the script
  51. RAISERROR (N'Unable to import job ''ASPState_Job_DeleteExpiredSessions'' since there is already a multi-server job with this name.', 16, 1)
  52. END
  53. ELSE
  54. -- Delete the [local] job
  55. EXECUTE msdb.dbo.sp_delete_job @job_name = N'ASPState_Job_DeleteExpiredSessions'
  56. END