home *** CD-ROM | disk | FTP | other *** search
/ 95.86.62.111 / 95.86.62.111.tar / 95.86.62.111 / sql2000 / INSTALL / dropall.sql < prev    next >
Text File  |  2000-07-04  |  58KB  |  2,898 lines

  1. ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
  2. Go
  3. /***********************************************************
  4. ** Copyright Microsoft, Inc. 1994 - 2000
  5. ** All Rights Reserved.
  6.  
  7.       Pre-Drops to reduce possible space fragmentation, and to
  8. avoid wasting time and space during DBCC UPGRADEDB.
  9.  
  10.       It is assumed this file is being run only thru ISQL.EXE,
  11. and that the MS SQL Server allows ad-hoc catalog updates.
  12.  
  13.  
  14. ***********************************************************/
  15. Go
  16.  
  17. use master
  18. set nocount on
  19. Go
  20.  
  21. Dump Transaction master with no_log
  22. Go
  23. Checkpoint
  24. Go
  25.  
  26. /***
  27.    Make sure server was started in single user mode (or that sp_configure?)
  28. was used to enable updates to system tables.
  29. ***/
  30.  
  31. if (select value from syscurconfigs where config = 102) <> 1
  32.         raiserror('Cannot run this file unless updates to system tables are enabled. Shutdown server and restart with the ''-m'' option to enable updates to system tables.'
  33.                         ,22,127) with log
  34.  
  35. Go
  36.  
  37. if object_id('#prc_dropall_1') is not null
  38.        drop procedure #prc_dropall_1
  39. Go
  40.  
  41. create procedure #prc_dropall_1
  42. as
  43.  
  44. set nocount on
  45.  
  46. Declare
  47.        @obj_type           char(2)
  48.       ,@obj_name           varchar(64)
  49.       ,@count_1               integer
  50.       ,@count_2               integer
  51.       ,@dump_size             integer
  52.       ,@dyn_cmd               varchar(127)
  53.       ,@BitMSObj              integer
  54.  
  55. Select @dump_size = 25
  56.  
  57. select 'db_name()=',db_name()
  58.  
  59. Print 'Object type counts immediately prior to the drops:'
  60.  
  61. Select type ,count(*) as 'Count_10' from sysobjects
  62.    where ObjectProperty(id, 'IsMSShipped') = 1
  63.    group by type order by type
  64.  
  65. Print ' '
  66.  
  67.  
  68. DECLARE
  69.              csr_17_todrop
  70.              insensitive
  71.              Cursor For
  72.    SELECT
  73.              obj.type
  74.             ,obj.name
  75.       from
  76.              sysobjects    obj
  77.       where  ObjectProperty(obj.id, 'IsMSShipped') = 1
  78.              AND (type != 'V' OR substring(name, 1, 3) != 'sys')
  79.       order by
  80.              obj.type
  81.             ,obj.name
  82.    FOR read only
  83.  
  84.  
  85. Open csr_17_todrop
  86.  
  87.  
  88. Select @count_1=0 ,@count_2=0
  89.  
  90.  
  91. WHILE (17=17)
  92.    begin
  93.  
  94.    FETCH        next
  95.       from      csr_17_todrop
  96.       into      @obj_type
  97.                ,@obj_name
  98.  
  99.    if (@@fetch_status <> 0)
  100.       begin
  101.       Deallocate csr_17_todrop
  102.       BREAK
  103.       end
  104.  
  105.    select @count_1 = @count_1 + 1
  106.  
  107.    if (@count_1 % (@dump_size) = 0)
  108.       begin
  109.       select @count_2 = @count_2 + @count_1
  110.       raiserror('So far %d Microsoft supplied sysobjects have been dropped.',0,1,@count_2) with nowait
  111.       select @count_1=0
  112.       dump transaction master with no_log
  113.       end
  114.  
  115.    select @dyn_cmd = '/' + '* pre case init *' + '/'
  116.  
  117.    select @dyn_cmd =
  118.             case @obj_type
  119.                when 'P ' then 'drop procedure ' + @obj_name
  120.                when 'U ' then 'drop table     ' + @obj_name
  121.                when 'TR' then 'drop trigger   ' + @obj_name
  122.                when 'V ' then 'drop view      ' + @obj_name
  123.                when 'X ' then 'dbcc dropextendedproc(''' + @obj_name + ''')'
  124.                else           '/' + '* Bypassing type=' +@obj_type+
  125.                               ' name=' +@obj_name+ ' *' + '/'
  126.             end
  127.  
  128.  
  129.    if (@obj_type = 'U ')  --Might contain user data.
  130.       begin
  131.  
  132.       if NOT (@obj_name in (  --Only these 'U ' can be dropped.
  133.  
  134.              'spt_values' ,'spt_monitor'
  135.             ,'spt_datatype_info' ,'spt_datatype_info_ext'
  136.             ,'spt_server_info'
  137.                               )
  138.              )
  139.          begin
  140.          raiserror('/* Bypassing type=%s name=%s, to avoid loss of user data. */'
  141.                   ,0,1,@obj_type,@obj_name)
  142.          CONTINUE
  143.          end
  144.       end
  145.  
  146.    print   @dyn_cmd
  147.    EXECUTE(@dyn_cmd)
  148.  
  149.    end -- loop 17
  150.  
  151.  
  152. Print ' '
  153. Print 'Object type counts immediately after dynamic drop logic:'
  154.  
  155. Select type,count(*) 'Count_30' from sysobjects
  156.    where ObjectProperty(id, 'IsMSShipped') = 1
  157.    group by type order by type
  158.  
  159. Print ' '
  160. --End of #prc_dropall_1 creation...
  161. Go
  162.  
  163. ------------------------  Run drops in some databases  --------------
  164.  
  165. use master
  166. go
  167. execute #prc_dropall_1
  168. go
  169.  
  170. declare @dbname varchar(30)
  171. select  @dbname = 'msdb'
  172.  
  173. if exists (select * from master..sysdatabases where name=@dbname)
  174.    begin
  175.    execute('use ' +@dbname+ ' exec #prc_dropall_1')
  176.    end
  177.  
  178. Go
  179.  
  180. use master
  181.  
  182. Go
  183.  
  184. if object_id('tempdb..#prc_dropall_1') is not null
  185.        drop procedure #prc_dropall_1
  186. Go
  187.  
  188. ---------- Special cases, and Hardcoded cases  -------------------
  189.  
  190. Go
  191.  
  192. if object_id('sp_dbcoalesce','P') IS NOT NULL
  193.     begin
  194.     print 'Dropping procedure sp_dbcoalesce (obsolete in MS SQL 6.5) ...'
  195.     drop procedure sp_dbcoalesce
  196.     end
  197. else
  198.     begin
  199.     print 'Nonexistent is procedure sp_dbcoalesce.'
  200.     end
  201.  
  202.  
  203. -- Above were special cases.
  204. Print ' '
  205. Go
  206.  
  207. if object_id('MS_sqlctrs_users','P') IS NOT NULL
  208.     begin
  209.     print 'Dropping procedure MS_sqlctrs_users ...'
  210.     drop procedure MS_sqlctrs_users
  211.     end
  212. else
  213.     begin
  214.     print 'Nonexistent is procedure MS_sqlctrs_users.'
  215.     end
  216.  
  217.  
  218. if object_id('sp_a_count_bits_on','P') IS NOT NULL
  219.     begin
  220.     print 'Dropping procedure sp_a_count_bits_on ...'
  221.     drop procedure sp_a_count_bits_on
  222.     end
  223. else
  224.     begin
  225.     print 'Nonexistent is procedure sp_a_count_bits_on.'
  226.     end
  227.  
  228.  
  229. if object_id('sp_abort_xact','P') IS NOT NULL
  230.     begin
  231.     print 'Dropping procedure sp_abort_xact ...'
  232.     drop procedure sp_abort_xact
  233.     end
  234. else
  235.     begin
  236.     print 'Nonexistent is procedure sp_abort_xact.'
  237.     end
  238.  
  239.  
  240. if object_id('sp_addalias','P') IS NOT NULL
  241.     begin
  242.     print 'Dropping procedure sp_addalias ...'
  243.     drop procedure sp_addalias
  244.     end
  245. else
  246.     begin
  247.     print 'Nonexistent is procedure sp_addalias.'
  248.     end
  249.  
  250.  
  251. if object_id('sp_addarticle','P') IS NOT NULL
  252.     begin
  253.     print 'Dropping procedure sp_addarticle ...'
  254.     drop procedure sp_addarticle
  255.     end
  256. else
  257.     begin
  258.     print 'Nonexistent is procedure sp_addarticle.'
  259.     end
  260.  
  261. Go
  262.  
  263. Dump Transaction master with no_log
  264. Go
  265.  
  266. if object_id('sp_addextendedproc','P') IS NOT NULL
  267.     begin
  268.     print 'Dropping procedure sp_addextendedproc ...'
  269.     drop procedure sp_addextendedproc
  270.     end
  271. else
  272.     begin
  273.     print 'Nonexistent is procedure sp_addextendedproc.'
  274.     end
  275.  
  276.  
  277. if object_id('sp_addgroup','P') IS NOT NULL
  278.     begin
  279.     print 'Dropping procedure sp_addgroup ...'
  280.     drop procedure sp_addgroup
  281.     end
  282. else
  283.     begin
  284.     print 'Nonexistent is procedure sp_addgroup.'
  285.     end
  286.  
  287.  
  288. if object_id('sp_addlogin','P') IS NOT NULL
  289.     begin
  290.     print 'Dropping procedure sp_addlogin ...'
  291.     drop procedure sp_addlogin
  292.     end
  293. else
  294.     begin
  295.     print 'Nonexistent is procedure sp_addlogin.'
  296.     end
  297.  
  298.  
  299. if object_id('sp_addmessage','P') IS NOT NULL
  300.     begin
  301.     print 'Dropping procedure sp_addmessage ...'
  302.     drop procedure sp_addmessage
  303.     end
  304. else
  305.     begin
  306.     print 'Nonexistent is procedure sp_addmessage.'
  307.     end
  308.  
  309. Go
  310.  
  311. if object_id('sp_addpublication','P') IS NOT NULL
  312.     begin
  313.     print 'Dropping procedure sp_addpublication ...'
  314.     drop procedure sp_addpublication
  315.     end
  316. else
  317.     begin
  318.     print 'Nonexistent is procedure sp_addpublication.'
  319.     end
  320.  
  321.  
  322. if object_id('sp_addpublisher','P') IS NOT NULL
  323.     begin
  324.     print 'Dropping procedure sp_addpublisher ...'
  325.     drop procedure sp_addpublisher
  326.     end
  327. else
  328.     begin
  329.     print 'Nonexistent is procedure sp_addpublisher.'
  330.     end
  331.  
  332.  
  333. if object_id('sp_addremotelogin','P') IS NOT NULL
  334.     begin
  335.     print 'Dropping procedure sp_addremotelogin ...'
  336.     drop procedure sp_addremotelogin
  337.     end
  338. else
  339.     begin
  340.     print 'Nonexistent is procedure sp_addremotelogin.'
  341.     end
  342.  
  343.  
  344. if object_id('sp_addsegment','P') IS NOT NULL
  345.     begin
  346.     print 'Dropping procedure sp_addsegment ...'
  347.     drop procedure sp_addsegment
  348.     end
  349. else
  350.     begin
  351.     print 'Nonexistent is procedure sp_addsegment.'
  352.     end
  353.  
  354.  
  355. if object_id('sp_addserver','P') IS NOT NULL
  356.     begin
  357.     print 'Dropping procedure sp_addserver ...'
  358.     drop procedure sp_addserver
  359.     end
  360. else
  361.     begin
  362.     print 'Nonexistent is procedure sp_addserver.'
  363.     end
  364.  
  365. Go
  366.  
  367. Dump Transaction master with no_log
  368. Go
  369.  
  370. if object_id('sp_addsubscriber','P') IS NOT NULL
  371.     begin
  372.     print 'Dropping procedure sp_addsubscriber ...'
  373.     drop procedure sp_addsubscriber
  374.     end
  375. else
  376.     begin
  377.     print 'Nonexistent is procedure sp_addsubscriber.'
  378.     end
  379.  
  380.  
  381. if object_id('sp_addsubscription','P') IS NOT NULL
  382.     begin
  383.     print 'Dropping procedure sp_addsubscription ...'
  384.     drop procedure sp_addsubscription
  385.     end
  386. else
  387.     begin
  388.     print 'Nonexistent is procedure sp_addsubscription.'
  389.     end
  390.  
  391.  
  392. if object_id('sp_addtype','P') IS NOT NULL
  393.     begin
  394.     print 'Dropping procedure sp_addtype ...'
  395.     drop procedure sp_addtype
  396.     end
  397. else
  398.     begin
  399.     print 'Nonexistent is procedure sp_addtype.'
  400.     end
  401.  
  402.  
  403. if object_id('sp_addumpdevice','P') IS NOT NULL
  404.     begin
  405.     print 'Dropping procedure sp_addumpdevice ...'
  406.     drop procedure sp_addumpdevice
  407.     end
  408. else
  409.     begin
  410.     print 'Nonexistent is procedure sp_addumpdevice.'
  411.     end
  412.  
  413.  
  414. if object_id('sp_adduser','P') IS NOT NULL
  415.     begin
  416.     print 'Dropping procedure sp_adduser ...'
  417.     drop procedure sp_adduser
  418.     end
  419. else
  420.     begin
  421.     print 'Nonexistent is procedure sp_adduser.'
  422.     end
  423.  
  424. Go
  425.  
  426. if object_id('sp_altermessage','P') IS NOT NULL
  427.     begin
  428.     print 'Dropping procedure sp_altermessage ...'
  429.     drop procedure sp_altermessage
  430.     end
  431. else
  432.     begin
  433.     print 'Nonexistent is procedure sp_altermessage.'
  434.     end
  435.  
  436.  
  437. if object_id('sp_articlecolumn','P') IS NOT NULL
  438.     begin
  439.     print 'Dropping procedure sp_articlecolumn ...'
  440.     drop procedure sp_articlecolumn
  441.     end
  442. else
  443.     begin
  444.     print 'Nonexistent is procedure sp_articlecolumn.'
  445.     end
  446.  
  447.  
  448. if object_id('sp_articlefilter','P') IS NOT NULL
  449.     begin
  450.     print 'Dropping procedure sp_articlefilter ...'
  451.     drop procedure sp_articlefilter
  452.     end
  453. else
  454.     begin
  455.     print 'Nonexistent is procedure sp_articlefilter.'
  456.     end
  457.  
  458.  
  459. if object_id('sp_articletextcol','P') IS NOT NULL
  460.     begin
  461.     print 'Dropping procedure sp_articletextcol ...'
  462.     drop procedure sp_articletextcol
  463.     end
  464. else
  465.     begin
  466.     print 'Nonexistent is procedure sp_articletextcol.'
  467.     end
  468.  
  469.  
  470. if object_id('sp_articleview','P') IS NOT NULL
  471.     begin
  472.     print 'Dropping procedure sp_articleview ...'
  473.     drop procedure sp_articleview
  474.     end
  475. else
  476.     begin
  477.     print 'Nonexistent is procedure sp_articleview.'
  478.     end
  479.  
  480. Go
  481.  
  482. Dump Transaction master with no_log
  483. Go
  484.  
  485. if object_id('sp_bindefault','P') IS NOT NULL
  486.     begin
  487.     print 'Dropping procedure sp_bindefault ...'
  488.     drop procedure sp_bindefault
  489.     end
  490. else
  491.     begin
  492.     print 'Nonexistent is procedure sp_bindefault.'
  493.     end
  494.  
  495.  
  496. if object_id('sp_bindrule','P') IS NOT NULL
  497.     begin
  498.     print 'Dropping procedure sp_bindrule ...'
  499.     drop procedure sp_bindrule
  500.     end
  501. else
  502.     begin
  503.     print 'Nonexistent is procedure sp_bindrule.'
  504.     end
  505.  
  506.  
  507. if object_id('sp_blockcnt','P') IS NOT NULL
  508.     begin
  509.     print 'Dropping procedure sp_blockcnt ...'
  510.     drop procedure sp_blockcnt
  511.     end
  512. else
  513.     begin
  514.     print 'Nonexistent is procedure sp_blockcnt.'
  515.     end
  516.  
  517.  
  518. if object_id('sp_certify_removable','P') IS NOT NULL
  519.     begin
  520.     print 'Dropping procedure sp_certify_removable ...'
  521.     drop procedure sp_certify_removable
  522.     end
  523. else
  524.     begin
  525.     print 'Nonexistent is procedure sp_certify_removable.'
  526.     end
  527.  
  528.  
  529. if object_id('sp_change_configstatus','P') IS NOT NULL
  530.     begin
  531.     print 'Dropping procedure sp_change_configstatus ...'
  532.     drop procedure sp_change_configstatus
  533.     end
  534. else
  535.     begin
  536.     print 'Nonexistent is procedure sp_change_configstatus.'
  537.     end
  538.  
  539. Go
  540.  
  541. if object_id('sp_change_users_login','P') IS NOT NULL
  542.     begin
  543.     print 'Dropping procedure sp_change_users_login ...'
  544.     drop procedure sp_change_users_login
  545.     end
  546. else
  547.     begin
  548.     print 'Nonexistent is procedure sp_change_users_login.'
  549.     end
  550.  
  551.  
  552. if object_id('sp_changearticle','P') IS NOT NULL
  553.     begin
  554.     print 'Dropping procedure sp_changearticle ...'
  555.     drop procedure sp_changearticle
  556.     end
  557. else
  558.     begin
  559.     print 'Nonexistent is procedure sp_changearticle.'
  560.     end
  561.  
  562.  
  563. if object_id('sp_changedbowner','P') IS NOT NULL
  564.     begin
  565.     print 'Dropping procedure sp_changedbowner ...'
  566.     drop procedure sp_changedbowner
  567.     end
  568. else
  569.     begin
  570.     print 'Nonexistent is procedure sp_changedbowner.'
  571.     end
  572.  
  573.  
  574. if object_id('sp_changegroup','P') IS NOT NULL
  575.     begin
  576.     print 'Dropping procedure sp_changegroup ...'
  577.     drop procedure sp_changegroup
  578.     end
  579. else
  580.     begin
  581.     print 'Nonexistent is procedure sp_changegroup.'
  582.     end
  583.  
  584.  
  585. if object_id('sp_changepublication','P') IS NOT NULL
  586.     begin
  587.     print 'Dropping procedure sp_changepublication ...'
  588.     drop procedure sp_changepublication
  589.     end
  590. else
  591.     begin
  592.     print 'Nonexistent is procedure sp_changepublication.'
  593.     end
  594.  
  595. Go
  596.  
  597. Dump Transaction master with no_log
  598. Go
  599.  
  600. if object_id('sp_changesubscriber','P') IS NOT NULL
  601.     begin
  602.     print 'Dropping procedure sp_changesubscriber ...'
  603.     drop procedure sp_changesubscriber
  604.     end
  605. else
  606.     begin
  607.     print 'Nonexistent is procedure sp_changesubscriber.'
  608.     end
  609.  
  610.  
  611. if object_id('sp_changesubscription','P') IS NOT NULL
  612.     begin
  613.     print 'Dropping procedure sp_changesubscription ...'
  614.     drop procedure sp_changesubscription
  615.     end
  616. else
  617.     begin
  618.     print 'Nonexistent is procedure sp_changesubscription.'
  619.     end
  620.  
  621.  
  622. if object_id('sp_changesubstatus','P') IS NOT NULL
  623.     begin
  624.     print 'Dropping procedure sp_changesubstatus ...'
  625.     drop procedure sp_changesubstatus
  626.     end
  627. else
  628.     begin
  629.     print 'Nonexistent is procedure sp_changesubstatus.'
  630.     end
  631.  
  632.  
  633. if object_id('sp_check_objects','P') IS NOT NULL
  634.     begin
  635.     print 'Dropping procedure sp_check_objects ...'
  636.     drop procedure sp_check_objects
  637.     end
  638. else
  639.     begin
  640.     print 'Nonexistent is procedure sp_check_objects.'
  641.     end
  642.  
  643.  
  644. if object_id('sp_check_removable','P') IS NOT NULL
  645.     begin
  646.     print 'Dropping procedure sp_check_removable ...'
  647.     drop procedure sp_check_removable
  648.     end
  649. else
  650.     begin
  651.     print 'Nonexistent is procedure sp_check_removable.'
  652.     end
  653.  
  654. Go
  655.  
  656. if object_id('sp_checknames','P') IS NOT NULL
  657.     begin
  658.     print 'Dropping procedure sp_checknames ...'
  659.     drop procedure sp_checknames
  660.     end
  661. else
  662.     begin
  663.     print 'Nonexistent is procedure sp_checknames.'
  664.     end
  665.  
  666.  
  667. if object_id('sp_chklangparam','P') IS NOT NULL
  668.     begin
  669.     print 'Dropping procedure sp_chklangparam ...'
  670.     drop procedure sp_chklangparam
  671.     end
  672. else
  673.     begin
  674.     print 'Nonexistent is procedure sp_chklangparam.'
  675.     end
  676.  
  677.  
  678. if object_id('sp_coalesce_fragments','P') IS NOT NULL
  679.     begin
  680.     print 'Dropping procedure sp_coalesce_fragments ...'
  681.     drop procedure sp_coalesce_fragments
  682.     end
  683. else
  684.     begin
  685.     print 'Nonexistent is procedure sp_coalesce_fragments.'
  686.     end
  687.  
  688.  
  689. if object_id('sp_column_privileges','P') IS NOT NULL
  690.     begin
  691.     print 'Dropping procedure sp_column_privileges ...'
  692.     drop procedure sp_column_privileges
  693.     end
  694. else
  695.     begin
  696.     print 'Nonexistent is procedure sp_column_privileges.'
  697.     end
  698.  
  699.  
  700. if object_id('sp_columns','P') IS NOT NULL
  701.     begin
  702.     print 'Dropping procedure sp_columns ...'
  703.     drop procedure sp_columns
  704.     end
  705. else
  706.     begin
  707.     print 'Nonexistent is procedure sp_columns.'
  708.     end
  709.  
  710. Go
  711.  
  712. Dump Transaction master with no_log
  713. Go
  714.  
  715. if object_id('sp_commit_xact','P') IS NOT NULL
  716.     begin
  717.     print 'Dropping procedure sp_commit_xact ...'
  718.     drop procedure sp_commit_xact
  719.     end
  720. else
  721.     begin
  722.     print 'Nonexistent is procedure sp_commit_xact.'
  723.     end
  724.  
  725.  
  726. if object_id('sp_commonkey','P') IS NOT NULL
  727.     begin
  728.     print 'Dropping procedure sp_commonkey ...'
  729.     drop procedure sp_commonkey
  730.     end
  731. else
  732.     begin
  733.     print 'Nonexistent is procedure sp_commonkey.'
  734.     end
  735.  
  736.  
  737. if object_id('sp_configure','P') IS NOT NULL
  738.     begin
  739.     print 'Dropping procedure sp_configure ...'
  740.     drop procedure sp_configure
  741.     end
  742. else
  743.     begin
  744.     print 'Nonexistent is procedure sp_configure.'
  745.     end
  746.  
  747.  
  748. if object_id('sp_create_distribution_tables','P') IS NOT NULL
  749.     begin
  750.     print 'Dropping procedure sp_create_distribution_tables ...'
  751.     drop procedure sp_create_distribution_tables
  752.     end
  753. else
  754.     begin
  755.     print 'Nonexistent is procedure sp_create_distribution_tables.'
  756.     end
  757.  
  758.  
  759. if object_id('sp_create_removable','P') IS NOT NULL
  760.     begin
  761.     print 'Dropping procedure sp_create_removable ...'
  762.     drop procedure sp_create_removable
  763.     end
  764. else
  765.     begin
  766.     print 'Nonexistent is procedure sp_create_removable.'
  767.     end
  768.  
  769. Go
  770.  
  771. if object_id('sp_databases','P') IS NOT NULL
  772.     begin
  773.     print 'Dropping procedure sp_databases ...'
  774.     drop procedure sp_databases
  775.     end
  776. else
  777.     begin
  778.     print 'Nonexistent is procedure sp_databases.'
  779.     end
  780.  
  781.  
  782. if object_id('sp_datatype_info','P') IS NOT NULL
  783.     begin
  784.     print 'Dropping procedure sp_datatype_info ...'
  785.     drop procedure sp_datatype_info
  786.     end
  787. else
  788.     begin
  789.     print 'Nonexistent is procedure sp_datatype_info.'
  790.     end
  791.  
  792.  
  793. if object_id('sp_db_upgrade','P') IS NOT NULL
  794.     begin
  795.     print 'Dropping procedure sp_db_upgrade ...'
  796.     drop procedure sp_db_upgrade
  797.     end
  798. else
  799.     begin
  800.     print 'Nonexistent is procedure sp_db_upgrade.'
  801.     end
  802.  
  803.  
  804. if object_id('sp_db_upgrade1','P') IS NOT NULL
  805.     begin
  806.     print 'Dropping procedure sp_db_upgrade1 ...'
  807.     drop procedure sp_db_upgrade1
  808.     end
  809. else
  810.     begin
  811.     print 'Nonexistent is procedure sp_db_upgrade1.'
  812.     end
  813.  
  814.  
  815. if object_id('sp_db_upgrade2','P') IS NOT NULL
  816.     begin
  817.     print 'Dropping procedure sp_db_upgrade2 ...'
  818.     drop procedure sp_db_upgrade2
  819.     end
  820. else
  821.     begin
  822.     print 'Nonexistent is procedure sp_db_upgrade2.'
  823.     end
  824.  
  825. Go
  826.  
  827. Dump Transaction master with no_log
  828. Go
  829.  
  830. if object_id('sp_dbinstall','P') IS NOT NULL
  831.     begin
  832.     print 'Dropping procedure sp_dbinstall ...'
  833.     drop procedure sp_dbinstall
  834.     end
  835. else
  836.     begin
  837.     print 'Nonexistent is procedure sp_dbinstall.'
  838.     end
  839.  
  840.  
  841. if object_id('sp_dboption','P') IS NOT NULL
  842.     begin
  843.     print 'Dropping procedure sp_dboption ...'
  844.     drop procedure sp_dboption
  845.     end
  846. else
  847.     begin
  848.     print 'Nonexistent is procedure sp_dboption.'
  849.     end
  850.  
  851.  
  852. if object_id('sp_dbremove','P') IS NOT NULL
  853.     begin
  854.     print 'Dropping procedure sp_dbremove ...'
  855.     drop procedure sp_dbremove
  856.     end
  857. else
  858.     begin
  859.     print 'Nonexistent is procedure sp_dbremove.'
  860.     end
  861.  
  862.  
  863. if object_id('sp_ddopen','P') IS NOT NULL
  864.     begin
  865.     print 'Dropping procedure sp_ddopen ...'
  866.     drop procedure sp_ddopen
  867.     end
  868. else
  869.     begin
  870.     print 'Nonexistent is procedure sp_ddopen.'
  871.     end
  872.  
  873.  
  874. if object_id('sp_defaultdb','P') IS NOT NULL
  875.     begin
  876.     print 'Dropping procedure sp_defaultdb ...'
  877.     drop procedure sp_defaultdb
  878.     end
  879. else
  880.     begin
  881.     print 'Nonexistent is procedure sp_defaultdb.'
  882.     end
  883.  
  884. Go
  885.  
  886. if object_id('sp_defaultlanguage','P') IS NOT NULL
  887.     begin
  888.     print 'Dropping procedure sp_defaultlanguage ...'
  889.     drop procedure sp_defaultlanguage
  890.     end
  891. else
  892.     begin
  893.     print 'Nonexistent is procedure sp_defaultlanguage.'
  894.     end
  895.  
  896.  
  897. if object_id('sp_depends','P') IS NOT NULL
  898.     begin
  899.     print 'Dropping procedure sp_depends ...'
  900.     drop procedure sp_depends
  901.     end
  902. else
  903.     begin
  904.     print 'Nonexistent is procedure sp_depends.'
  905.     end
  906.  
  907.  
  908. if object_id('sp_devcreate','P') IS NOT NULL
  909.     begin
  910.     print 'Dropping procedure sp_devcreate ...'
  911.     drop procedure sp_devcreate
  912.     end
  913. else
  914.     begin
  915.     print 'Nonexistent is procedure sp_devcreate.'
  916.     end
  917.  
  918.  
  919. if object_id('sp_devoption','P') IS NOT NULL
  920.     begin
  921.     print 'Dropping procedure sp_devoption ...'
  922.     drop procedure sp_devoption
  923.     end
  924. else
  925.     begin
  926.     print 'Nonexistent is procedure sp_devoption.'
  927.     end
  928.  
  929.  
  930. if object_id('sp_diskdefault','P') IS NOT NULL
  931.     begin
  932.     print 'Dropping procedure sp_diskdefault ...'
  933.     drop procedure sp_diskdefault
  934.     end
  935. else
  936.     begin
  937.     print 'Nonexistent is procedure sp_diskdefault.'
  938.     end
  939.  
  940. Go
  941.  
  942. Dump Transaction master with no_log
  943. Go
  944.  
  945. if object_id('sp_distcounters','P') IS NOT NULL
  946.     begin
  947.     print 'Dropping procedure sp_distcounters ...'
  948.     drop procedure sp_distcounters
  949.     end
  950. else
  951.     begin
  952.     print 'Nonexistent is procedure sp_distcounters.'
  953.     end
  954.  
  955.  
  956. if object_id('sp_dropalias','P') IS NOT NULL
  957.     begin
  958.     print 'Dropping procedure sp_dropalias ...'
  959.     drop procedure sp_dropalias
  960.     end
  961. else
  962.     begin
  963.     print 'Nonexistent is procedure sp_dropalias.'
  964.     end
  965.  
  966.  
  967. if object_id('sp_droparticle','P') IS NOT NULL
  968.     begin
  969.     print 'Dropping procedure sp_droparticle ...'
  970.     drop procedure sp_droparticle
  971.     end
  972. else
  973.     begin
  974.     print 'Nonexistent is procedure sp_droparticle.'
  975.     end
  976.  
  977.  
  978. if object_id('sp_dropdevice','P') IS NOT NULL
  979.     begin
  980.     print 'Dropping procedure sp_dropdevice ...'
  981.     drop procedure sp_dropdevice
  982.     end
  983. else
  984.     begin
  985.     print 'Nonexistent is procedure sp_dropdevice.'
  986.     end
  987.  
  988.  
  989. if object_id('sp_dropextendedproc','P') IS NOT NULL
  990.     begin
  991.     print 'Dropping procedure sp_dropextendedproc ...'
  992.     drop procedure sp_dropextendedproc
  993.     end
  994. else
  995.     begin
  996.     print 'Nonexistent is procedure sp_dropextendedproc.'
  997.     end
  998.  
  999. Go
  1000.  
  1001. if object_id('sp_dropgroup','P') IS NOT NULL
  1002.     begin
  1003.     print 'Dropping procedure sp_dropgroup ...'
  1004.     drop procedure sp_dropgroup
  1005.     end
  1006. else
  1007.     begin
  1008.     print 'Nonexistent is procedure sp_dropgroup.'
  1009.     end
  1010.  
  1011.  
  1012. if object_id('sp_dropkey','P') IS NOT NULL
  1013.     begin
  1014.     print 'Dropping procedure sp_dropkey ...'
  1015.     drop procedure sp_dropkey
  1016.     end
  1017. else
  1018.     begin
  1019.     print 'Nonexistent is procedure sp_dropkey.'
  1020.     end
  1021.  
  1022.  
  1023. if object_id('sp_droplogin','P') IS NOT NULL
  1024.     begin
  1025.     print 'Dropping procedure sp_droplogin ...'
  1026.     drop procedure sp_droplogin
  1027.     end
  1028. else
  1029.     begin
  1030.     print 'Nonexistent is procedure sp_droplogin.'
  1031.     end
  1032.  
  1033.  
  1034. if object_id('sp_dropmessage','P') IS NOT NULL
  1035.     begin
  1036.     print 'Dropping procedure sp_dropmessage ...'
  1037.     drop procedure sp_dropmessage
  1038.     end
  1039. else
  1040.     begin
  1041.     print 'Nonexistent is procedure sp_dropmessage.'
  1042.     end
  1043.  
  1044. Go
  1045.  
  1046. Dump Transaction master with no_log
  1047. Go
  1048.  
  1049. if object_id('sp_droppublication','P') IS NOT NULL
  1050.     begin
  1051.     print 'Dropping procedure sp_droppublication ...'
  1052.     drop procedure sp_droppublication
  1053.     end
  1054. else
  1055.     begin
  1056.     print 'Nonexistent is procedure sp_droppublication.'
  1057.     end
  1058.  
  1059.  
  1060. if object_id('sp_droppublisher','P') IS NOT NULL
  1061.     begin
  1062.     print 'Dropping procedure sp_droppublisher ...'
  1063.     drop procedure sp_droppublisher
  1064.     end
  1065. else
  1066.     begin
  1067.     print 'Nonexistent is procedure sp_droppublisher.'
  1068.     end
  1069.  
  1070.  
  1071. if object_id('sp_dropremotelogin','P') IS NOT NULL
  1072.     begin
  1073.     print 'Dropping procedure sp_dropremotelogin ...'
  1074.     drop procedure sp_dropremotelogin
  1075.     end
  1076. else
  1077.     begin
  1078.     print 'Nonexistent is procedure sp_dropremotelogin.'
  1079.     end
  1080.  
  1081.  
  1082. if object_id('sp_dropsegment','P') IS NOT NULL
  1083.     begin
  1084.     print 'Dropping procedure sp_dropsegment ...'
  1085.     drop procedure sp_dropsegment
  1086.     end
  1087. else
  1088.     begin
  1089.     print 'Nonexistent is procedure sp_dropsegment.'
  1090.     end
  1091.  
  1092.  
  1093. if object_id('sp_dropserver','P') IS NOT NULL
  1094.     begin
  1095.     print 'Dropping procedure sp_dropserver ...'
  1096.     drop procedure sp_dropserver
  1097.     end
  1098. else
  1099.     begin
  1100.     print 'Nonexistent is procedure sp_dropserver.'
  1101.     end
  1102.  
  1103. Go
  1104.  
  1105. if object_id('sp_dropsubscriber','P') IS NOT NULL
  1106.     begin
  1107.     print 'Dropping procedure sp_dropsubscriber ...'
  1108.     drop procedure sp_dropsubscriber
  1109.     end
  1110. else
  1111.     begin
  1112.     print 'Nonexistent is procedure sp_dropsubscriber.'
  1113.     end
  1114.  
  1115.  
  1116. if object_id('sp_dropsubscription','P') IS NOT NULL
  1117.     begin
  1118.     print 'Dropping procedure sp_dropsubscription ...'
  1119.     drop procedure sp_dropsubscription
  1120.     end
  1121. else
  1122.     begin
  1123.     print 'Nonexistent is procedure sp_dropsubscription.'
  1124.     end
  1125.  
  1126.  
  1127. if object_id('sp_droptype','P') IS NOT NULL
  1128.     begin
  1129.     print 'Dropping procedure sp_droptype ...'
  1130.     drop procedure sp_droptype
  1131.     end
  1132. else
  1133.     begin
  1134.     print 'Nonexistent is procedure sp_droptype.'
  1135.     end
  1136.  
  1137.  
  1138. if object_id('sp_dropuser','P') IS NOT NULL
  1139.     begin
  1140.     print 'Dropping procedure sp_dropuser ...'
  1141.     drop procedure sp_dropuser
  1142.     end
  1143. else
  1144.     begin
  1145.     print 'Nonexistent is procedure sp_dropuser.'
  1146.     end
  1147.  
  1148.  
  1149. if object_id('sp_dsninfo','P') IS NOT NULL
  1150.     begin
  1151.     print 'Dropping procedure sp_dsninfo ...'
  1152.     drop procedure sp_dsninfo
  1153.     end
  1154. else
  1155.     begin
  1156.     print 'Nonexistent is procedure sp_dsninfo.'
  1157.     end
  1158.  
  1159. Go
  1160.  
  1161. if object_id('sp_enumdsn','P') IS NOT NULL
  1162.     begin
  1163.     print 'Dropping procedure sp_enumdsn ...'
  1164.     drop procedure sp_enumdsn
  1165.     end
  1166. else
  1167.     begin
  1168.     print 'Nonexistent is procedure sp_enumdsn.'
  1169.     end
  1170.  
  1171.  
  1172. if object_id('sp_enumfullsubscribers','P') IS NOT NULL
  1173.     begin
  1174.     print 'Dropping procedure sp_enumfullsubscribers ...'
  1175.     drop procedure sp_enumfullsubscribers
  1176.     end
  1177. else
  1178.     begin
  1179.     print 'Nonexistent is procedure sp_enumfullsubscribers.'
  1180.     end
  1181.  
  1182.  
  1183. if object_id('sp_extendsegment','P') IS NOT NULL
  1184.     begin
  1185.     print 'Dropping procedure sp_extendsegment ...'
  1186.     drop procedure sp_extendsegment
  1187.     end
  1188. else
  1189.     begin
  1190.     print 'Nonexistent is procedure sp_extendsegment.'
  1191.     end
  1192.  
  1193.  
  1194. if object_id('sp_fixindex','P') IS NOT NULL
  1195.     begin
  1196.     print 'Dropping procedure sp_fixindex ...'
  1197.     drop procedure sp_fixindex
  1198.     end
  1199. else
  1200.     begin
  1201.     print 'Nonexistent is procedure sp_fixindex.'
  1202.     end
  1203.  
  1204.  
  1205. if object_id('sp_fkeys','P') IS NOT NULL
  1206.     begin
  1207.     print 'Dropping procedure sp_fkeys ...'
  1208.     drop procedure sp_fkeys
  1209.     end
  1210. else
  1211.     begin
  1212.     print 'Nonexistent is procedure sp_fkeys.'
  1213.     end
  1214.  
  1215. Go
  1216.  
  1217. Dump Transaction master with no_log
  1218. Go
  1219.  
  1220. if object_id('sp_foreignkey','P') IS NOT NULL
  1221.     begin
  1222.     print 'Dropping procedure sp_foreignkey ...'
  1223.     drop procedure sp_foreignkey
  1224.     end
  1225. else
  1226.     begin
  1227.     print 'Nonexistent is procedure sp_foreignkey.'
  1228.     end
  1229.  
  1230.  
  1231. if object_id('sp_get_volume_label','P') IS NOT NULL
  1232.     begin
  1233.     print 'Dropping procedure sp_get_volume_label ...'
  1234.     drop procedure sp_get_volume_label
  1235.     end
  1236. else
  1237.     begin
  1238.     print 'Nonexistent is procedure sp_get_volume_label.'
  1239.     end
  1240.  
  1241.  
  1242. if object_id('sp_hcchangesubstatus1','P') IS NOT NULL
  1243.     begin
  1244.     print 'Dropping procedure sp_hcchangesubstatus1 ...'
  1245.     drop procedure sp_hcchangesubstatus1
  1246.     end
  1247. else
  1248.     begin
  1249.     print 'Nonexistent is procedure sp_hcchangesubstatus1.'
  1250.     end
  1251.  
  1252.  
  1253. if object_id('sp_hcchangesubstatus2','P') IS NOT NULL
  1254.     begin
  1255.     print 'Dropping procedure sp_hcchangesubstatus2 ...'
  1256.     drop procedure sp_hcchangesubstatus2
  1257.     end
  1258. else
  1259.     begin
  1260.     print 'Nonexistent is procedure sp_hcchangesubstatus2.'
  1261.     end
  1262.  
  1263.  
  1264. if object_id('sp_help','P') IS NOT NULL
  1265.     begin
  1266.     print 'Dropping procedure sp_help ...'
  1267.     drop procedure sp_help
  1268.     end
  1269. else
  1270.     begin
  1271.     print 'Nonexistent is procedure sp_help.'
  1272.     end
  1273.  
  1274. Go
  1275.  
  1276. if object_id('sp_help_revdatabase','P') IS NOT NULL
  1277.     begin
  1278.     print 'Dropping procedure sp_help_revdatabase ...'
  1279.     drop procedure sp_help_revdatabase
  1280.     end
  1281. else
  1282.     begin
  1283.     print 'Nonexistent is procedure sp_help_revdatabase.'
  1284.     end
  1285.  
  1286.  
  1287. if object_id('sp_help_setopts','P') IS NOT NULL
  1288.     begin
  1289.     print 'Dropping procedure sp_help_setopts ...'
  1290.     drop procedure sp_help_setopts
  1291.     end
  1292. else
  1293.     begin
  1294.     print 'Nonexistent is procedure sp_help_setopts.'
  1295.     end
  1296.  
  1297.  
  1298. if object_id('sp_helparticle','P') IS NOT NULL
  1299.     begin
  1300.     print 'Dropping procedure sp_helparticle ...'
  1301.     drop procedure sp_helparticle
  1302.     end
  1303. else
  1304.     begin
  1305.     print 'Nonexistent is procedure sp_helparticle.'
  1306.     end
  1307.  
  1308.  
  1309. if object_id('sp_helparticlecolumns','P') IS NOT NULL
  1310.     begin
  1311.     print 'Dropping procedure sp_helparticlecolumns ...'
  1312.     drop procedure sp_helparticlecolumns
  1313.     end
  1314. else
  1315.     begin
  1316.     print 'Nonexistent is procedure sp_helparticlecolumns.'
  1317.     end
  1318.  
  1319.  
  1320. if object_id('sp_helpconstraint','P') IS NOT NULL
  1321.     begin
  1322.     print 'Dropping procedure sp_helpconstraint ...'
  1323.     drop procedure sp_helpconstraint
  1324.     end
  1325. else
  1326.     begin
  1327.     print 'Nonexistent is procedure sp_helpconstraint.'
  1328.     end
  1329.  
  1330. Go
  1331.  
  1332. if object_id('sp_helpdb','P') IS NOT NULL
  1333.     begin
  1334.     print 'Dropping procedure sp_helpdb ...'
  1335.     drop procedure sp_helpdb
  1336.     end
  1337. else
  1338.     begin
  1339.     print 'Nonexistent is procedure sp_helpdb.'
  1340.     end
  1341.  
  1342.  
  1343. if object_id('sp_helpdevice','P') IS NOT NULL
  1344.     begin
  1345.     print 'Dropping procedure sp_helpdevice ...'
  1346.     drop procedure sp_helpdevice
  1347.     end
  1348. else
  1349.     begin
  1350.     print 'Nonexistent is procedure sp_helpdevice.'
  1351.     end
  1352.  
  1353.  
  1354. if object_id('sp_helpdistributor','P') IS NOT NULL
  1355.     begin
  1356.     print 'Dropping procedure sp_helpdistributor ...'
  1357.     drop procedure sp_helpdistributor
  1358.     end
  1359. else
  1360.     begin
  1361.     print 'Nonexistent is procedure sp_helpdistributor.'
  1362.     end
  1363.  
  1364.  
  1365. if object_id('sp_helpextendedproc','P') IS NOT NULL
  1366.     begin
  1367.     print 'Dropping procedure sp_helpextendedproc ...'
  1368.     drop procedure sp_helpextendedproc
  1369.     end
  1370. else
  1371.     begin
  1372.     print 'Nonexistent is procedure sp_helpextendedproc.'
  1373.     end
  1374.  
  1375.  
  1376. if object_id('sp_helpgroup','P') IS NOT NULL
  1377.     begin
  1378.     print 'Dropping procedure sp_helpgroup ...'
  1379.     drop procedure sp_helpgroup
  1380.     end
  1381. else
  1382.     begin
  1383.     print 'Nonexistent is procedure sp_helpgroup.'
  1384.     end
  1385.  
  1386. Go
  1387.  
  1388. if object_id('sp_helpindex','P') IS NOT NULL
  1389.     begin
  1390.     print 'Dropping procedure sp_helpindex ...'
  1391.     drop procedure sp_helpindex
  1392.     end
  1393. else
  1394.     begin
  1395.     print 'Nonexistent is procedure sp_helpindex.'
  1396.     end
  1397.  
  1398. if object_id('sp_helpstats','P') IS NOT NULL
  1399.     begin
  1400.     print 'Dropping procedure sp_helpstats ...'
  1401.     drop procedure sp_helpstats
  1402.     end
  1403. else
  1404.     begin
  1405.     print 'Nonexistent is procedure sp_helpstats.'
  1406.     end
  1407.  
  1408. if object_id('sp_helpjoins','P') IS NOT NULL
  1409.     begin
  1410.     print 'Dropping procedure sp_helpjoins ...'
  1411.     drop procedure sp_helpjoins
  1412.     end
  1413. else
  1414.     begin
  1415.     print 'Nonexistent is procedure sp_helpjoins.'
  1416.     end
  1417.  
  1418.  
  1419. if object_id('sp_helpkey','P') IS NOT NULL
  1420.     begin
  1421.     print 'Dropping procedure sp_helpkey ...'
  1422.     drop procedure sp_helpkey
  1423.     end
  1424. else
  1425.     begin
  1426.     print 'Nonexistent is procedure sp_helpkey.'
  1427.     end
  1428.  
  1429.  
  1430. if object_id('sp_helplanguage','P') IS NOT NULL
  1431.     begin
  1432.     print 'Dropping procedure sp_helplanguage ...'
  1433.     drop procedure sp_helplanguage
  1434.     end
  1435. else
  1436.     begin
  1437.     print 'Nonexistent is procedure sp_helplanguage.'
  1438.     end
  1439.  
  1440.  
  1441. if object_id('sp_helplog','P') IS NOT NULL
  1442.     begin
  1443.     print 'Dropping procedure sp_helplog ...'
  1444.     drop procedure sp_helplog
  1445.     end
  1446. else
  1447.     begin
  1448.     print 'Nonexistent is procedure sp_helplog.'
  1449.     end
  1450.  
  1451. Go
  1452.  
  1453. Dump Transaction master with no_log
  1454. Go
  1455.  
  1456. if object_id('sp_helplogins','P') IS NOT NULL
  1457.     begin
  1458.     print 'Dropping procedure sp_helplogins ...'
  1459.     drop procedure sp_helplogins
  1460.     end
  1461. else
  1462.     begin
  1463.     print 'Nonexistent is procedure sp_helplogins.'
  1464.     end
  1465.  
  1466.  
  1467. if object_id('sp_helppublication','P') IS NOT NULL
  1468.     begin
  1469.     print 'Dropping procedure sp_helppublication ...'
  1470.     drop procedure sp_helppublication
  1471.     end
  1472. else
  1473.     begin
  1474.     print 'Nonexistent is procedure sp_helppublication.'
  1475.     end
  1476.  
  1477.  
  1478. if object_id('sp_helppublicationsync','P') IS NOT NULL
  1479.     begin
  1480.     print 'Dropping procedure sp_helppublicationsync ...'
  1481.     drop procedure sp_helppublicationsync
  1482.     end
  1483. else
  1484.     begin
  1485.     print 'Nonexistent is procedure sp_helppublicationsync.'
  1486.     end
  1487.  
  1488.  
  1489. if object_id('sp_helpremotelogin','P') IS NOT NULL
  1490.     begin
  1491.     print 'Dropping procedure sp_helpremotelogin ...'
  1492.     drop procedure sp_helpremotelogin
  1493.     end
  1494. else
  1495.     begin
  1496.     print 'Nonexistent is procedure sp_helpremotelogin.'
  1497.     end
  1498.  
  1499.  
  1500. if object_id('sp_helpreplicationdb','P') IS NOT NULL
  1501.     begin
  1502.     print 'Dropping procedure sp_helpreplicationdb ...'
  1503.     drop procedure sp_helpreplicationdb
  1504.     end
  1505. else
  1506.     begin
  1507.     print 'Nonexistent is procedure sp_helpreplicationdb.'
  1508.     end
  1509.  
  1510. Go
  1511.  
  1512. if object_id('sp_helprotect','P') IS NOT NULL
  1513.     begin
  1514.     print 'Dropping procedure sp_helprotect ...'
  1515.     drop procedure sp_helprotect
  1516.     end
  1517. else
  1518.     begin
  1519.     print 'Nonexistent is procedure sp_helprotect.'
  1520.     end
  1521.  
  1522.  
  1523. if object_id('sp_helpsegment','P') IS NOT NULL
  1524.     begin
  1525.     print 'Dropping procedure sp_helpsegment ...'
  1526.     drop procedure sp_helpsegment
  1527.     end
  1528. else
  1529.     begin
  1530.     print 'Nonexistent is procedure sp_helpsegment.'
  1531.     end
  1532.  
  1533.  
  1534. if object_id('sp_helpserver','P') IS NOT NULL
  1535.     begin
  1536.     print 'Dropping procedure sp_helpserver ...'
  1537.     drop procedure sp_helpserver
  1538.     end
  1539. else
  1540.     begin
  1541.     print 'Nonexistent is procedure sp_helpserver.'
  1542.     end
  1543.  
  1544.  
  1545. if object_id('sp_helpsort','P') IS NOT NULL
  1546.     begin
  1547.     print 'Dropping procedure sp_helpsort ...'
  1548.     drop procedure sp_helpsort
  1549.     end
  1550. else
  1551.     begin
  1552.     print 'Nonexistent is procedure sp_helpsort.'
  1553.     end
  1554.  
  1555.  
  1556. Print 'Bypassing procedure sp_helpsql.'
  1557. Go
  1558.  
  1559. if object_id('sp_helpstartup','P') IS NOT NULL
  1560.     begin
  1561.     print 'Dropping procedure sp_helpstartup ...'
  1562.     drop procedure sp_helpstartup
  1563.     end
  1564. else
  1565.     begin
  1566.     print 'Nonexistent is procedure sp_helpstartup.'
  1567.     end
  1568.  
  1569.  
  1570. if object_id('sp_helpsubscriberinfo','P') IS NOT NULL
  1571.     begin
  1572.     print 'Dropping procedure sp_helpsubscriberinfo ...'
  1573.     drop procedure sp_helpsubscriberinfo
  1574.     end
  1575. else
  1576.     begin
  1577.     print 'Nonexistent is procedure sp_helpsubscriberinfo.'
  1578.     end
  1579.  
  1580.  
  1581. if object_id('sp_helpsubscription','P') IS NOT NULL
  1582.     begin
  1583.     print 'Dropping procedure sp_helpsubscription ...'
  1584.     drop procedure sp_helpsubscription
  1585.     end
  1586. else
  1587.     begin
  1588.     print 'Nonexistent is procedure sp_helpsubscription.'
  1589.     end
  1590.  
  1591.  
  1592. if object_id('sp_helptext','P') IS NOT NULL
  1593.     begin
  1594.     print 'Dropping procedure sp_helptext ...'
  1595.     drop procedure sp_helptext
  1596.     end
  1597. else
  1598.     begin
  1599.     print 'Nonexistent is procedure sp_helptext.'
  1600.     end
  1601.  
  1602.  
  1603. if object_id('sp_helpuser','P') IS NOT NULL
  1604.     begin
  1605.     print 'Dropping procedure sp_helpuser ...'
  1606.     drop procedure sp_helpuser
  1607.     end
  1608. else
  1609.     begin
  1610.     print 'Nonexistent is procedure sp_helpuser.'
  1611.     end
  1612.  
  1613. Go
  1614.  
  1615. if object_id('sp_lock','P') IS NOT NULL
  1616.     begin
  1617.     print 'Dropping procedure sp_lock ...'
  1618.     drop procedure sp_lock
  1619.     end
  1620. else
  1621.     begin
  1622.     print 'Nonexistent is procedure sp_lock.'
  1623.     end
  1624.  
  1625.  
  1626. if object_id('sp_lock2','P') IS NOT NULL
  1627.     begin
  1628.     print 'Dropping procedure sp_lock2 ...'
  1629.     drop procedure sp_lock2
  1630.     end
  1631. else
  1632.     begin
  1633.     print 'Nonexistent is procedure sp_lock2.'
  1634.     end
  1635.  
  1636.  
  1637. if object_id('sp_lockinfo','P') IS NOT NULL
  1638.     begin
  1639.     print 'Dropping procedure sp_lockinfo ...'
  1640.     drop procedure sp_lockinfo
  1641.     end
  1642. else
  1643.     begin
  1644.     print 'Nonexistent is procedure sp_lockinfo.'
  1645.     end
  1646.  
  1647.  
  1648. if object_id('sp_logdevice','P') IS NOT NULL
  1649.     begin
  1650.     print 'Dropping procedure sp_logdevice ...'
  1651.     drop procedure sp_logdevice
  1652.     end
  1653. else
  1654.     begin
  1655.     print 'Nonexistent is procedure sp_logdevice.'
  1656.     end
  1657.  
  1658.  
  1659. if object_id('sp_lookup','P') IS NOT NULL
  1660.     begin
  1661.     print 'Dropping procedure sp_lookup ...'
  1662.     drop procedure sp_lookup
  1663.     end
  1664. else
  1665.     begin
  1666.     print 'Nonexistent is procedure sp_lookup.'
  1667.     end
  1668.  
  1669. Go
  1670.  
  1671. Dump Transaction master with no_log
  1672. Go
  1673.  
  1674. if object_id('sp_makestartup','P') IS NOT NULL
  1675.     begin
  1676.     print 'Dropping procedure sp_makestartup ...'
  1677.     drop procedure sp_makestartup
  1678.     end
  1679. else
  1680.     begin
  1681.     print 'Nonexistent is procedure sp_makestartup.'
  1682.     end
  1683.  
  1684.  
  1685. if object_id('sp_makewebpage','P') IS NOT NULL
  1686.     begin
  1687.     print 'Dropping procedure sp_makewebpage ...'
  1688.     drop procedure sp_makewebpage
  1689.     end
  1690. else
  1691.     begin
  1692.     print 'Nonexistent is procedure sp_makewebpage.'
  1693.     end
  1694.  
  1695.  
  1696. if object_id('sp_markreport','P') IS NOT NULL
  1697.     begin
  1698.     print 'Dropping procedure sp_markreport ...'
  1699.     drop procedure sp_markreport
  1700.     end
  1701. else
  1702.     begin
  1703.     print 'Nonexistent is procedure sp_markreport.'
  1704.     end
  1705.  
  1706.  
  1707. if object_id('sp_monitor','P') IS NOT NULL
  1708.     begin
  1709.     print 'Dropping procedure sp_monitor ...'
  1710.     drop procedure sp_monitor
  1711.     end
  1712. else
  1713.     begin
  1714.     print 'Nonexistent is procedure sp_monitor.'
  1715.     end
  1716.  
  1717.  
  1718. if object_id('sp_MSdbuserprofile','P') IS NOT NULL
  1719.     begin
  1720.     print 'Dropping procedure sp_MSdbuserprofile ...'
  1721.     drop procedure sp_MSdbuserprofile
  1722.     end
  1723. else
  1724.     begin
  1725.     print 'Nonexistent is procedure sp_MSdbuserprofile.'
  1726.     end
  1727.  
  1728. Go
  1729.  
  1730. if object_id('sp_MSdependencies','P') IS NOT NULL
  1731.     begin
  1732.     print 'Dropping procedure sp_MSdependencies ...'
  1733.     drop procedure sp_MSdependencies
  1734.     end
  1735. else
  1736.     begin
  1737.     print 'Nonexistent is procedure sp_MSdependencies.'
  1738.     end
  1739.  
  1740.  
  1741. if object_id('sp_MSfilterclause','P') IS NOT NULL
  1742.     begin
  1743.     print 'Dropping procedure sp_MSfilterclause ...'
  1744.     drop procedure sp_MSfilterclause
  1745.     end
  1746. else
  1747.     begin
  1748.     print 'Nonexistent is procedure sp_MSfilterclause.'
  1749.     end
  1750.  
  1751.  
  1752. if object_id('sp_MSforeach_worker','P') IS NOT NULL
  1753.     begin
  1754.     print 'Dropping procedure sp_MSforeach_worker ...'
  1755.     drop procedure sp_MSforeach_worker
  1756.     end
  1757. else
  1758.     begin
  1759.     print 'Nonexistent is procedure sp_MSforeach_worker.'
  1760.     end
  1761.  
  1762.  
  1763. if object_id('sp_MSforeachdb','P') IS NOT NULL
  1764.     begin
  1765.     print 'Dropping procedure sp_MSforeachdb ...'
  1766.     drop procedure sp_MSforeachdb
  1767.     end
  1768. else
  1769.     begin
  1770.     print 'Nonexistent is procedure sp_MSforeachdb.'
  1771.     end
  1772.  
  1773.  
  1774. if object_id('sp_MSforeachtable','P') IS NOT NULL
  1775.     begin
  1776.     print 'Dropping procedure sp_MSforeachtable ...'
  1777.     drop procedure sp_MSforeachtable
  1778.     end
  1779. else
  1780.     begin
  1781.     print 'Nonexistent is procedure sp_MSforeachtable.'
  1782.     end
  1783.  
  1784. Go
  1785.  
  1786. if object_id('sp_MSgetalertinfo','P') IS NOT NULL
  1787.     begin
  1788.     print 'Dropping procedure sp_MSgetalertinfo ...'
  1789.     drop procedure sp_MSgetalertinfo
  1790.     end
  1791. else
  1792.     begin
  1793.     print 'Nonexistent is procedure sp_MSgetalertinfo.'
  1794.     end
  1795.  
  1796. if object_id('sp_MSget_current_activity','P') IS NOT NULL
  1797.     begin
  1798.     print 'Dropping procedure sp_MSget_current_activity ...'
  1799.     drop procedure sp_MSget_current_activity
  1800.     end
  1801. else
  1802.     begin
  1803.     print 'Nonexistent is procedure sp_MSget_current_activity.'
  1804.     end
  1805.  
  1806. if object_id('sp_MSgetexecinfo','P') IS NOT NULL
  1807.     begin
  1808.     print 'Dropping procedure sp_MSgetexecinfo ...'
  1809.     drop procedure sp_MSgetexecinfo
  1810.     end
  1811. else
  1812.     begin
  1813.     print 'Nonexistent is procedure sp_MSgetexecinfo.'
  1814.     end
  1815.  
  1816.  
  1817. if object_id('sp_MShelpcolumns','P') IS NOT NULL
  1818.     begin
  1819.     print 'Dropping procedure sp_MShelpcolumns ...'
  1820.     drop procedure sp_MShelpcolumns
  1821.     end
  1822. else
  1823.     begin
  1824.     print 'Nonexistent is procedure sp_MShelpcolumns.'
  1825.     end
  1826.  
  1827.  
  1828. if object_id('sp_MShelpindex','P') IS NOT NULL
  1829.     begin
  1830.     print 'Dropping procedure sp_MShelpindex ...'
  1831.     drop procedure sp_MShelpindex
  1832.     end
  1833. else
  1834.     begin
  1835.     print 'Nonexistent is procedure sp_MShelpindex.'
  1836.     end
  1837.  
  1838.  
  1839. if object_id('sp_MShelptype','P') IS NOT NULL
  1840.     begin
  1841.     print 'Dropping procedure sp_MShelptype ...'
  1842.     drop procedure sp_MShelptype
  1843.     end
  1844. else
  1845.     begin
  1846.     print 'Nonexistent is procedure sp_MShelptype.'
  1847.     end
  1848.  
  1849. Go
  1850.  
  1851. Dump Transaction master with no_log
  1852. Go
  1853.  
  1854. if object_id('sp_MSindexspace','P') IS NOT NULL
  1855.     begin
  1856.     print 'Dropping procedure sp_MSindexspace ...'
  1857.     drop procedure sp_MSindexspace
  1858.     end
  1859. else
  1860.     begin
  1861.     print 'Nonexistent is procedure sp_MSindexspace.'
  1862.     end
  1863.  
  1864.  
  1865. if object_id('sp_MSkilldb','P') IS NOT NULL
  1866.     begin
  1867.     print 'Dropping procedure sp_MSkilldb ...'
  1868.     drop procedure sp_MSkilldb
  1869.     end
  1870. else
  1871.     begin
  1872.     print 'Nonexistent is procedure sp_MSkilldb.'
  1873.     end
  1874.  
  1875.  
  1876. if object_id('sp_MSloginmappings','P') IS NOT NULL
  1877.     begin
  1878.     print 'Dropping procedure sp_MSloginmappings ...'
  1879.     drop procedure sp_MSloginmappings
  1880.     end
  1881. else
  1882.     begin
  1883.     print 'Nonexistent is procedure sp_MSloginmappings.'
  1884.     end
  1885.  
  1886.  
  1887. if object_id('sp_MSmatchkey','P') IS NOT NULL
  1888.     begin
  1889.     print 'Dropping procedure sp_MSmatchkey ...'
  1890.     drop procedure sp_MSmatchkey
  1891.     end
  1892. else
  1893.     begin
  1894.     print 'Nonexistent is procedure sp_MSmatchkey.'
  1895.     end
  1896.  
  1897.  
  1898. if object_id('sp_MSobjectprivs','P') IS NOT NULL
  1899.     begin
  1900.     print 'Dropping procedure sp_MSobjectprivs ...'
  1901.     drop procedure sp_MSobjectprivs
  1902.     end
  1903. else
  1904.     begin
  1905.     print 'Nonexistent is procedure sp_MSobjectprivs.'
  1906.     end
  1907.  
  1908. Go
  1909.  
  1910. if object_id('sp_MSsetalertinfo','P') IS NOT NULL
  1911.     begin
  1912.     print 'Dropping procedure sp_MSsetalertinfo ...'
  1913.     drop procedure sp_MSsetalertinfo
  1914.     end
  1915. else
  1916.     begin
  1917.     print 'Nonexistent is procedure sp_MSsetalertinfo.'
  1918.     end
  1919.  
  1920. if object_id('sp_MSset_current_activity','P') IS NOT NULL
  1921.     begin
  1922.     print 'Dropping procedure sp_MSset_current_activity ...'
  1923.     drop procedure sp_MSset_current_activity
  1924.     end
  1925. else
  1926.     begin
  1927.     print 'Nonexistent is procedure sp_MSset_current_activity.'
  1928.     end
  1929.  
  1930. if object_id('sp_MSsetexecinfo','P') IS NOT NULL
  1931.     begin
  1932.     print 'Dropping procedure sp_MSsetexecinfo ...'
  1933.     drop procedure sp_MSsetexecinfo
  1934.     end
  1935. else
  1936.     begin
  1937.     print 'Nonexistent is procedure sp_MSsetexecinfo.'
  1938.     end
  1939.  
  1940.  
  1941. if object_id('sp_MSsettopology','P') IS NOT NULL
  1942.     begin
  1943.     print 'Dropping procedure sp_MSsettopology ...'
  1944.     drop procedure sp_MSsettopology
  1945.     end
  1946. else
  1947.     begin
  1948.     print 'Nonexistent is procedure sp_MSsettopology.'
  1949.     end
  1950.  
  1951.  
  1952. if object_id('sp_MSSQLOLE_version','P') IS NOT NULL
  1953.     begin
  1954.     print 'Dropping procedure sp_MSSQLOLE_version ...'
  1955.     drop procedure sp_MSSQLOLE_version
  1956.     end
  1957. else
  1958.     begin
  1959.     print 'Nonexistent is procedure sp_MSSQLOLE_version.'
  1960.     end
  1961.  
  1962.  
  1963. if object_id('sp_MSsubscriptions','P') IS NOT NULL
  1964.     begin
  1965.     print 'Dropping procedure sp_MSsubscriptions ...'
  1966.     drop procedure sp_MSsubscriptions
  1967.     end
  1968. else
  1969.     begin
  1970.     print 'Nonexistent is procedure sp_MSsubscriptions.'
  1971.     end
  1972.  
  1973. Go
  1974.  
  1975. if object_id('sp_MStablechecks','P') IS NOT NULL
  1976.     begin
  1977.     print 'Dropping procedure sp_MStablechecks ...'
  1978.     drop procedure sp_MStablechecks
  1979.     end
  1980. else
  1981.     begin
  1982.     print 'Nonexistent is procedure sp_MStablechecks.'
  1983.     end
  1984.  
  1985.  
  1986. if object_id('sp_MStablekeys','P') IS NOT NULL
  1987.     begin
  1988.     print 'Dropping procedure sp_MStablekeys ...'
  1989.     drop procedure sp_MStablekeys
  1990.     end
  1991. else
  1992.     begin
  1993.     print 'Nonexistent is procedure sp_MStablekeys.'
  1994.     end
  1995.  
  1996.  
  1997. if object_id('sp_MStablerefs','P') IS NOT NULL
  1998.     begin
  1999.     print 'Dropping procedure sp_MStablerefs ...'
  2000.     drop procedure sp_MStablerefs
  2001.     end
  2002. else
  2003.     begin
  2004.     print 'Nonexistent is procedure sp_MStablerefs.'
  2005.     end
  2006.  
  2007.  
  2008. if object_id('sp_MStablespace','P') IS NOT NULL
  2009.     begin
  2010.     print 'Dropping procedure sp_MStablespace ...'
  2011.     drop procedure sp_MStablespace
  2012.     end
  2013. else
  2014.     begin
  2015.     print 'Nonexistent is procedure sp_MStablespace.'
  2016.     end
  2017.  
  2018.  
  2019. if object_id('sp_MSuniquename','P') IS NOT NULL
  2020.     begin
  2021.     print 'Dropping procedure sp_MSuniquename ...'
  2022.     drop procedure sp_MSuniquename
  2023.     end
  2024. else
  2025.     begin
  2026.     print 'Nonexistent is procedure sp_MSuniquename.'
  2027.     end
  2028.  
  2029. Go
  2030.  
  2031. Dump Transaction master with no_log
  2032. Go
  2033.  
  2034. if object_id('sp_namecrack','P') IS NOT NULL
  2035.     begin
  2036.     print 'Dropping procedure sp_namecrack ...'
  2037.     drop procedure sp_namecrack
  2038.     end
  2039. else
  2040.     begin
  2041.     print 'Nonexistent is procedure sp_namecrack.'
  2042.     end
  2043.  
  2044.  
  2045. if object_id('sp_objcheck','P') IS NOT NULL
  2046.     begin
  2047.     print 'Dropping procedure sp_objcheck ...'
  2048.     drop procedure sp_objcheck
  2049.     end
  2050. else
  2051.     begin
  2052.     print 'Nonexistent is procedure sp_objcheck.'
  2053.     end
  2054.  
  2055.  
  2056. if object_id('sp_objectsegment','P') IS NOT NULL
  2057.     begin
  2058.     print 'Dropping procedure sp_objectsegment ...'
  2059.     drop procedure sp_objectsegment
  2060.     end
  2061. else
  2062.     begin
  2063.     print 'Nonexistent is procedure sp_objectsegment.'
  2064.     end
  2065.  
  2066.  
  2067. if object_id('sp_password','P') IS NOT NULL
  2068.     begin
  2069.     print 'Dropping procedure sp_password ...'
  2070.     drop procedure sp_password
  2071.     end
  2072. else
  2073.     begin
  2074.     print 'Nonexistent is procedure sp_password.'
  2075.     end
  2076.  
  2077.  
  2078. if object_id('sp_pkeys','P') IS NOT NULL
  2079.     begin
  2080.     print 'Dropping procedure sp_pkeys ...'
  2081.     drop procedure sp_pkeys
  2082.     end
  2083. else
  2084.     begin
  2085.     print 'Nonexistent is procedure sp_pkeys.'
  2086.     end
  2087.  
  2088. Go
  2089.  
  2090. if object_id('sp_placeobject','P') IS NOT NULL
  2091.     begin
  2092.     print 'Dropping procedure sp_placeobject ...'
  2093.     drop procedure sp_placeobject
  2094.     end
  2095. else
  2096.     begin
  2097.     print 'Nonexistent is procedure sp_placeobject.'
  2098.     end
  2099.  
  2100.  
  2101. if object_id('sp_primarykey','P') IS NOT NULL
  2102.     begin
  2103.     print 'Dropping procedure sp_primarykey ...'
  2104.     drop procedure sp_primarykey
  2105.     end
  2106. else
  2107.     begin
  2108.     print 'Nonexistent is procedure sp_primarykey.'
  2109.     end
  2110.  
  2111.  
  2112. if object_id('sp_probe_xact','P') IS NOT NULL
  2113.     begin
  2114.     print 'Dropping procedure sp_probe_xact ...'
  2115.     drop procedure sp_probe_xact
  2116.     end
  2117. else
  2118.     begin
  2119.     print 'Nonexistent is procedure sp_probe_xact.'
  2120.     end
  2121.  
  2122.  
  2123. if object_id('sp_processinfo','P') IS NOT NULL
  2124.     begin
  2125.     print 'Dropping procedure sp_processinfo ...'
  2126.     drop procedure sp_processinfo
  2127.     end
  2128. else
  2129.     begin
  2130.     print 'Nonexistent is procedure sp_processinfo.'
  2131.     end
  2132.  
  2133.  
  2134. if object_id('sp_processmail','P') IS NOT NULL
  2135.     begin
  2136.     print 'Dropping procedure sp_processmail ...'
  2137.     drop procedure sp_processmail
  2138.     end
  2139. else
  2140.     begin
  2141.     print 'Nonexistent is procedure sp_processmail.'
  2142.     end
  2143.  
  2144. Go
  2145.  
  2146. Dump Transaction master with no_log
  2147. Go
  2148.  
  2149. if object_id('sp_publishdb','P') IS NOT NULL
  2150.     begin
  2151.     print 'Dropping procedure sp_publishdb ...'
  2152.     drop procedure sp_publishdb
  2153.     end
  2154. else
  2155.     begin
  2156.     print 'Nonexistent is procedure sp_publishdb.'
  2157.     end
  2158.  
  2159.  
  2160. if object_id('sp_recompile','P') IS NOT NULL
  2161.     begin
  2162.     print 'Dropping procedure sp_recompile ...'
  2163.     drop procedure sp_recompile
  2164.     end
  2165. else
  2166.     begin
  2167.     print 'Nonexistent is procedure sp_recompile.'
  2168.     end
  2169.  
  2170.  
  2171. if object_id('sp_remoteoption','P') IS NOT NULL
  2172.     begin
  2173.     print 'Dropping procedure sp_remoteoption ...'
  2174.     drop procedure sp_remoteoption
  2175.     end
  2176. else
  2177.     begin
  2178.     print 'Nonexistent is procedure sp_remoteoption.'
  2179.     end
  2180.  
  2181.  
  2182. if object_id('sp_remove_xact','P') IS NOT NULL
  2183.     begin
  2184.     print 'Dropping procedure sp_remove_xact ...'
  2185.     drop procedure sp_remove_xact
  2186.     end
  2187. else
  2188.     begin
  2189.     print 'Nonexistent is procedure sp_remove_xact.'
  2190.     end
  2191.  
  2192.  
  2193. if object_id('sp_rename','P') IS NOT NULL
  2194.     begin
  2195.     print 'Dropping procedure sp_rename ...'
  2196.     drop procedure sp_rename
  2197.     end
  2198. else
  2199.     begin
  2200.     print 'Nonexistent is procedure sp_rename.'
  2201.     end
  2202.  
  2203. Go
  2204.  
  2205. if object_id('sp_renamedb','P') IS NOT NULL
  2206.     begin
  2207.     print 'Dropping procedure sp_renamedb ...'
  2208.     drop procedure sp_renamedb
  2209.     end
  2210. else
  2211.     begin
  2212.     print 'Nonexistent is procedure sp_renamedb.'
  2213.     end
  2214.  
  2215.  
  2216. if object_id('sp_replica','P') IS NOT NULL
  2217.     begin
  2218.     print 'Dropping procedure sp_replica ...'
  2219.     drop procedure sp_replica
  2220.     end
  2221. else
  2222.     begin
  2223.     print 'Nonexistent is procedure sp_replica.'
  2224.     end
  2225.  
  2226. if object_id('sp_scan_xact','P') IS NOT NULL
  2227.     begin
  2228.     print 'Dropping procedure sp_scan_xact ...'
  2229.     drop procedure sp_scan_xact
  2230.     end
  2231. else
  2232.     begin
  2233.     print 'Nonexistent is procedure sp_scan_xact.'
  2234.     end
  2235.  
  2236.  
  2237. if object_id('sp_schedulersignal','P') IS NOT NULL
  2238.     begin
  2239.     print 'Dropping procedure sp_schedulersignal ...'
  2240.     drop procedure sp_schedulersignal
  2241.     end
  2242. else
  2243.     begin
  2244.     print 'Nonexistent is procedure sp_schedulersignal.'
  2245.     end
  2246.  
  2247. Go
  2248.  
  2249. if object_id('sp_seguse','P') IS NOT NULL
  2250.     begin
  2251.     print 'Dropping procedure sp_seguse ...'
  2252.     drop procedure sp_seguse
  2253.     end
  2254. else
  2255.     begin
  2256.     print 'Nonexistent is procedure sp_seguse.'
  2257.     end
  2258.  
  2259.  
  2260. if object_id('sp_server_info','P') IS NOT NULL
  2261.     begin
  2262.     print 'Dropping procedure sp_server_info ...'
  2263.     drop procedure sp_server_info
  2264.     end
  2265. else
  2266.     begin
  2267.     print 'Nonexistent is procedure sp_server_info.'
  2268.     end
  2269.  
  2270.  
  2271. if object_id('sp_serveroption','P') IS NOT NULL
  2272.     begin
  2273.     print 'Dropping procedure sp_serveroption ...'
  2274.     drop procedure sp_serveroption
  2275.     end
  2276. else
  2277.     begin
  2278.     print 'Nonexistent is procedure sp_serveroption.'
  2279.     end
  2280.  
  2281.  
  2282. if object_id('sp_setlangalias','P') IS NOT NULL
  2283.     begin
  2284.     print 'Dropping procedure sp_setlangalias ...'
  2285.     drop procedure sp_setlangalias
  2286.     end
  2287. else
  2288.     begin
  2289.     print 'Nonexistent is procedure sp_setlangalias.'
  2290.     end
  2291.  
  2292.  
  2293. if object_id('sp_setnetname','P') IS NOT NULL
  2294.     begin
  2295.     print 'Dropping procedure sp_setnetname ...'
  2296.     drop procedure sp_setnetname
  2297.     end
  2298. else
  2299.     begin
  2300.     print 'Nonexistent is procedure sp_setnetname.'
  2301.     end
  2302.  
  2303. Go
  2304.  
  2305. Dump Transaction master with no_log
  2306. Go
  2307.  
  2308. if object_id('sp_spaceused','P') IS NOT NULL
  2309.     begin
  2310.     print 'Dropping procedure sp_spaceused ...'
  2311.     drop procedure sp_spaceused
  2312.     end
  2313. else
  2314.     begin
  2315.     print 'Nonexistent is procedure sp_spaceused.'
  2316.     end
  2317.  
  2318. if object_id('sp_checktabletempsize','P') IS NOT NULL
  2319.     begin
  2320.     print 'Dropping procedure sp_checktabletempsize ...'
  2321.     drop procedure sp_checktabletempsize
  2322.     end
  2323. else
  2324.     begin
  2325.     print 'Nonexistent is procedure sp_checktabletempsize.'
  2326.     end
  2327.  
  2328. if object_id('sp_checkdbtempsize','P') IS NOT NULL
  2329.     begin
  2330.     print 'Dropping procedure sp_checkdbtempsize ...'
  2331.     drop procedure sp_checkdbtempsize
  2332.     end
  2333. else
  2334.     begin
  2335.     print 'Nonexistent is procedure sp_checkdbtempsize.'
  2336.     end
  2337.  
  2338. if object_id('sp_special_columns','P') IS NOT NULL
  2339.     begin
  2340.     print 'Dropping procedure sp_special_columns ...'
  2341.     drop procedure sp_special_columns
  2342.     end
  2343. else
  2344.     begin
  2345.     print 'Nonexistent is procedure sp_special_columns.'
  2346.     end
  2347.  
  2348.  
  2349. if object_id('sp_sproc_columns','P') IS NOT NULL
  2350.     begin
  2351.     print 'Dropping procedure sp_sproc_columns ...'
  2352.     drop procedure sp_sproc_columns
  2353.     end
  2354. else
  2355.     begin
  2356.     print 'Nonexistent is procedure sp_sproc_columns.'
  2357.     end
  2358.  
  2359.  
  2360. if object_id('sp_sqlexec','P') IS NOT NULL
  2361.     begin
  2362.     print 'Dropping procedure sp_sqlexec ...'
  2363.     drop procedure sp_sqlexec
  2364.     end
  2365. else
  2366.     begin
  2367.     print 'Nonexistent is procedure sp_sqlexec.'
  2368.     end
  2369.  
  2370.  
  2371. if object_id('sp_sqlregister','P') IS NOT NULL
  2372.     begin
  2373.     print 'Dropping procedure sp_sqlregister ...'
  2374.     drop procedure sp_sqlregister
  2375.     end
  2376. else
  2377.     begin
  2378.     print 'Nonexistent is procedure sp_sqlregister.'
  2379.     end
  2380.  
  2381. Go
  2382.  
  2383. if object_id('sp_start_xact','P') IS NOT NULL
  2384.     begin
  2385.     print 'Dropping procedure sp_start_xact ...'
  2386.     drop procedure sp_start_xact
  2387.     end
  2388. else
  2389.     begin
  2390.     print 'Nonexistent is procedure sp_start_xact.'
  2391.     end
  2392.  
  2393.  
  2394. if object_id('sp_stat_xact','P') IS NOT NULL
  2395.     begin
  2396.     print 'Dropping procedure sp_stat_xact ...'
  2397.     drop procedure sp_stat_xact
  2398.     end
  2399. else
  2400.     begin
  2401.     print 'Nonexistent is procedure sp_stat_xact.'
  2402.     end
  2403.  
  2404.  
  2405. if object_id('sp_statistics','P') IS NOT NULL
  2406.     begin
  2407.     print 'Dropping procedure sp_statistics ...'
  2408.     drop procedure sp_statistics
  2409.     end
  2410. else
  2411.     begin
  2412.     print 'Nonexistent is procedure sp_statistics.'
  2413.     end
  2414.  
  2415.  
  2416. if object_id('sp_stored_procedures','P') IS NOT NULL
  2417.     begin
  2418.     print 'Dropping procedure sp_stored_procedures ...'
  2419.     drop procedure sp_stored_procedures
  2420.     end
  2421. else
  2422.     begin
  2423.     print 'Nonexistent is procedure sp_stored_procedures.'
  2424.     end
  2425.  
  2426.  
  2427. if object_id('sp_subscribe','P') IS NOT NULL
  2428.     begin
  2429.     print 'Dropping procedure sp_subscribe ...'
  2430.     drop procedure sp_subscribe
  2431.     end
  2432. else
  2433.     begin
  2434.     print 'Nonexistent is procedure sp_subscribe.'
  2435.     end
  2436.  
  2437. Go
  2438.  
  2439. Dump Transaction master with no_log
  2440. Go
  2441.  
  2442. if object_id('sp_table_privileges','P') IS NOT NULL
  2443.     begin
  2444.     print 'Dropping procedure sp_table_privileges ...'
  2445.     drop procedure sp_table_privileges
  2446.     end
  2447. else
  2448.     begin
  2449.     print 'Nonexistent is procedure sp_table_privileges.'
  2450.     end
  2451.  
  2452.  
  2453. if object_id('sp_tables','P') IS NOT NULL
  2454.     begin
  2455.     print 'Dropping procedure sp_tables ...'
  2456.     drop procedure sp_tables
  2457.     end
  2458. else
  2459.     begin
  2460.     print 'Nonexistent is procedure sp_tables.'
  2461.     end
  2462.  
  2463.  
  2464. if object_id('sp_tempdbspace','P') IS NOT NULL
  2465.     begin
  2466.     print 'Dropping procedure sp_tempdbspace ...'
  2467.     drop procedure sp_tempdbspace
  2468.     end
  2469. else
  2470.     begin
  2471.     print 'Nonexistent is procedure sp_tempdbspace.'
  2472.     end
  2473.  
  2474.  
  2475. if object_id('sp_textcolstatus','P') IS NOT NULL
  2476.     begin
  2477.     print 'Dropping procedure sp_textcolstatus ...'
  2478.     drop procedure sp_textcolstatus
  2479.     end
  2480. else
  2481.     begin
  2482.     print 'Nonexistent is procedure sp_textcolstatus.'
  2483.     end
  2484.  
  2485.  
  2486. if object_id('sp_tphelp','P') IS NOT NULL
  2487.     begin
  2488.     print 'Dropping procedure sp_tphelp ...'
  2489.     drop procedure sp_tphelp
  2490.     end
  2491. else
  2492.     begin
  2493.     print 'Nonexistent is procedure sp_tphelp.'
  2494.     end
  2495.  
  2496. Go
  2497.  
  2498. if object_id('sp_tphelp2','P') IS NOT NULL
  2499.     begin
  2500.     print 'Dropping procedure sp_tphelp2 ...'
  2501.     drop procedure sp_tphelp2
  2502.     end
  2503. else
  2504.     begin
  2505.     print 'Nonexistent is procedure sp_tphelp2.'
  2506.     end
  2507.  
  2508.  
  2509. if object_id('sp_unbindefault','P') IS NOT NULL
  2510.     begin
  2511.     print 'Dropping procedure sp_unbindefault ...'
  2512.     drop procedure sp_unbindefault
  2513.     end
  2514. else
  2515.     begin
  2516.     print 'Nonexistent is procedure sp_unbindefault.'
  2517.     end
  2518.  
  2519.  
  2520. if object_id('sp_MSuninstall_publishing','P') IS NOT NULL
  2521.     begin
  2522.     print 'Dropping procedure sp_MSuninstall_publishing ...'
  2523.     drop procedure sp_MSuninstall_publishing
  2524.     end
  2525. else
  2526.     begin
  2527.     print 'Nonexistent is procedure sp_MSuninstall_publishing.'
  2528.     end
  2529.  
  2530.  
  2531. if object_id('sp_unbindrule','P') IS NOT NULL
  2532.     begin
  2533.     print 'Dropping procedure sp_unbindrule ...'
  2534.     drop procedure sp_unbindrule
  2535.     end
  2536. else
  2537.     begin
  2538.     print 'Nonexistent is procedure sp_unbindrule.'
  2539.     end
  2540.  
  2541.  
  2542. if object_id('sp_unmakestartup','P') IS NOT NULL
  2543.     begin
  2544.     print 'Dropping procedure sp_unmakestartup ...'
  2545.     drop procedure sp_unmakestartup
  2546.     end
  2547. else
  2548.     begin
  2549.     print 'Nonexistent is procedure sp_unmakestartup.'
  2550.     end
  2551.  
  2552.  
  2553. if object_id('sp_unsubscribe','P') IS NOT NULL
  2554.     begin
  2555.     print 'Dropping procedure sp_unsubscribe ...'
  2556.     drop procedure sp_unsubscribe
  2557.     end
  2558. else
  2559.     begin
  2560.     print 'Nonexistent is procedure sp_unsubscribe.'
  2561.     end
  2562.  
  2563. Go
  2564.  
  2565. if object_id('sp_user_counter1','P') IS NOT NULL
  2566.     begin
  2567.     print 'Dropping procedure sp_user_counter1 ...'
  2568.     drop procedure sp_user_counter1
  2569.     end
  2570. else
  2571.     begin
  2572.     print 'Nonexistent is procedure sp_user_counter1.'
  2573.     end
  2574.  
  2575.  
  2576. if object_id('sp_user_counter10','P') IS NOT NULL
  2577.     begin
  2578.     print 'Dropping procedure sp_user_counter10 ...'
  2579.     drop procedure sp_user_counter10
  2580.     end
  2581. else
  2582.     begin
  2583.     print 'Nonexistent is procedure sp_user_counter10.'
  2584.     end
  2585.  
  2586.  
  2587. if object_id('sp_user_counter2','P') IS NOT NULL
  2588.     begin
  2589.     print 'Dropping procedure sp_user_counter2 ...'
  2590.     drop procedure sp_user_counter2
  2591.     end
  2592. else
  2593.     begin
  2594.     print 'Nonexistent is procedure sp_user_counter2.'
  2595.     end
  2596.  
  2597.  
  2598. if object_id('sp_user_counter3','P') IS NOT NULL
  2599.     begin
  2600.     print 'Dropping procedure sp_user_counter3 ...'
  2601.     drop procedure sp_user_counter3
  2602.     end
  2603. else
  2604.     begin
  2605.     print 'Nonexistent is procedure sp_user_counter3.'
  2606.     end
  2607.  
  2608.  
  2609. if object_id('sp_user_counter4','P') IS NOT NULL
  2610.     begin
  2611.     print 'Dropping procedure sp_user_counter4 ...'
  2612.     drop procedure sp_user_counter4
  2613.     end
  2614. else
  2615.     begin
  2616.     print 'Nonexistent is procedure sp_user_counter4.'
  2617.     end
  2618.  
  2619. Go
  2620.  
  2621. Dump Transaction master with no_log
  2622. Go
  2623.  
  2624. if object_id('sp_user_counter5','P') IS NOT NULL
  2625.     begin
  2626.     print 'Dropping procedure sp_user_counter5 ...'
  2627.     drop procedure sp_user_counter5
  2628.     end
  2629. else
  2630.     begin
  2631.     print 'Nonexistent is procedure sp_user_counter5.'
  2632.     end
  2633.  
  2634.  
  2635. if object_id('sp_user_counter6','P') IS NOT NULL
  2636.     begin
  2637.     print 'Dropping procedure sp_user_counter6 ...'
  2638.     drop procedure sp_user_counter6
  2639.     end
  2640. else
  2641.     begin
  2642.     print 'Nonexistent is procedure sp_user_counter6.'
  2643.     end
  2644.  
  2645.  
  2646. if object_id('sp_user_counter7','P') IS NOT NULL
  2647.     begin
  2648.     print 'Dropping procedure sp_user_counter7 ...'
  2649.     drop procedure sp_user_counter7
  2650.     end
  2651. else
  2652.     begin
  2653.     print 'Nonexistent is procedure sp_user_counter7.'
  2654.     end
  2655.  
  2656.  
  2657. if object_id('sp_user_counter8','P') IS NOT NULL
  2658.     begin
  2659.     print 'Dropping procedure sp_user_counter8 ...'
  2660.     drop procedure sp_user_counter8
  2661.     end
  2662. else
  2663.     begin
  2664.     print 'Nonexistent is procedure sp_user_counter8.'
  2665.     end
  2666.  
  2667.  
  2668. if object_id('sp_user_counter9','P') IS NOT NULL
  2669.     begin
  2670.     print 'Dropping procedure sp_user_counter9 ...'
  2671.     drop procedure sp_user_counter9
  2672.     end
  2673. else
  2674.     begin
  2675.     print 'Nonexistent is procedure sp_user_counter9.'
  2676.     end
  2677.  
  2678. Go
  2679.  
  2680. if object_id('sp_userdefcounters','P') IS NOT NULL
  2681.     begin
  2682.     print 'Dropping procedure sp_userdefcounters ...'
  2683.     drop procedure sp_userdefcounters
  2684.     end
  2685. else
  2686.     begin
  2687.     print 'Nonexistent is procedure sp_userdefcounters.'
  2688.     end
  2689.  
  2690.  
  2691. if object_id('sp_validlang','P') IS NOT NULL
  2692.     begin
  2693.     print 'Dropping procedure sp_validlang ...'
  2694.     drop procedure sp_validlang
  2695.     end
  2696. else
  2697.     begin
  2698.     print 'Nonexistent is procedure sp_validlang.'
  2699.     end
  2700.  
  2701.  
  2702. if object_id('sp_validname','P') IS NOT NULL
  2703.     begin
  2704.     print 'Dropping procedure sp_validname ...'
  2705.     drop procedure sp_validname
  2706.     end
  2707. else
  2708.     begin
  2709.     print 'Nonexistent is procedure sp_validname.'
  2710.     end
  2711.  
  2712.  
  2713. if object_id('sp_who','P') IS NOT NULL
  2714.     begin
  2715.     print 'Dropping procedure sp_who ...b'
  2716.     drop procedure sp_who
  2717.     end
  2718. else
  2719.     begin
  2720.     print 'Nonexistent is procedure sp_who.'
  2721.     end
  2722.  
  2723.  
  2724. if object_id('sp_who2','P') IS NOT NULL
  2725.     begin
  2726.     print 'Dropping procedure sp_who2 ...'
  2727.     drop procedure sp_who2
  2728.     end
  2729. else
  2730.     begin
  2731.     print 'Nonexistent is procedure sp_who2.'
  2732.     end
  2733.  
  2734. Go
  2735.  
  2736. if object_id('sp_xpoption','P') IS NOT NULL
  2737.     begin
  2738.     print 'Dropping procedure sp_xpoption ...'
  2739.     drop procedure sp_xpoption
  2740.     end
  2741. else
  2742.     begin
  2743.     print 'Nonexistent is procedure sp_xpoption.'
  2744.     end
  2745.  
  2746.  
  2747. Print 'Bypassing table helpsql.'
  2748.  
  2749.  
  2750. if object_id('MSobjects','U') IS NOT NULL
  2751.     begin
  2752.     print 'Dropping table MSobjects ...'
  2753.     drop table MSobjects
  2754.     end
  2755. else
  2756.     begin
  2757.     print 'Nonexistent is table MSobjects.'
  2758.     end
  2759.  
  2760.  
  2761. Go
  2762.  
  2763.  
  2764. if object_id('spt_datatype_info','U') IS NOT NULL
  2765.     begin
  2766.     print 'Dropping table spt_datatype_info ...'
  2767.     drop table spt_datatype_info
  2768.     end
  2769. else
  2770.     begin
  2771.     print 'Nonexistent is table spt_datatype_info.'
  2772.     end
  2773.  
  2774.  
  2775. if object_id('spt_datatype_info_ext','U') IS NOT NULL
  2776.     begin
  2777.     print 'Dropping table spt_datatype_info_ext ...'
  2778.     drop table spt_datatype_info_ext
  2779.     end
  2780. else
  2781.     begin
  2782.     print 'Nonexistent is table spt_datatype_info_ext.'
  2783.     end
  2784.  
  2785.  
  2786. if object_id('spt_monitor','U') IS NOT NULL
  2787.     begin
  2788.     print 'Dropping table spt_monitor ...'
  2789.     drop table spt_monitor
  2790.     end
  2791. else
  2792.     begin
  2793.     print 'Nonexistent is table spt_monitor.'
  2794.     end
  2795.  
  2796.  
  2797. if object_id('spt_server_info','U') IS NOT NULL
  2798.     begin
  2799.     print 'Dropping table spt_server_info ...'
  2800.     drop table spt_server_info
  2801.     end
  2802. else
  2803.     begin
  2804.     print 'Nonexistent is table spt_server_info.'
  2805.     end
  2806.  
  2807. Go
  2808.  
  2809. Dump Transaction master with no_log
  2810. Go
  2811.  
  2812. if object_id('spt_values','U') IS NOT NULL
  2813.     begin
  2814.     print 'Dropping table spt_values ...'
  2815.     drop table spt_values
  2816.     end
  2817. else
  2818.     begin
  2819.     print 'Nonexistent is table spt_values.'
  2820.     end
  2821.  
  2822. if object_id('sp_grantdenylogin','P') IS NOT NULL
  2823.     begin
  2824.     print 'Dropping procedure sp_grantdenylogin ...'
  2825.     drop procedure sp_grantdenylogin
  2826.     end
  2827. else
  2828.     begin
  2829.     print 'Nonexistent is procedure sp_grantdenylogin.'
  2830.     end
  2831.  
  2832. if object_id('sp_grantlogin','P') IS NOT NULL
  2833.     begin
  2834.     print 'Dropping procedure sp_grantlogin ...'
  2835.     drop procedure sp_grantlogin
  2836.     end
  2837. else
  2838.     begin
  2839.     print 'Nonexistent is procedure sp_grantlogin.'
  2840.     end
  2841.  
  2842. if object_id('sp_denylogin','P') IS NOT NULL
  2843.     begin
  2844.     print 'Dropping procedure sp_denylogin ...'
  2845.     drop procedure sp_denylogin
  2846.     end
  2847. else
  2848.     begin
  2849.     print 'Nonexistent is procedure sp_denylogin.'
  2850.     end
  2851.  
  2852. if object_id('sp_addgroupmember','P') IS NOT NULL
  2853.     begin
  2854.     print 'Dropping procedure sp_addgroupmember ...'
  2855.     drop procedure sp_addgroupmember
  2856.     end
  2857. else
  2858.     begin
  2859.     print 'Nonexistent is procedure sp_addgroupmember.'
  2860.     end
  2861.  
  2862. if object_id('sp_dropgroupmember','P') IS NOT NULL
  2863.     begin
  2864.     print 'Dropping procedure sp_dropgroupmember ...'
  2865.     drop procedure sp_dropgroupmember
  2866.     end
  2867. else
  2868.     begin
  2869.     print 'Nonexistent is procedure sp_dropgroupmember.'
  2870.     end
  2871.  
  2872. Go
  2873. set nocount off
  2874. Go
  2875.  
  2876. Print 'Procedures & User Tables still present:'
  2877.  
  2878. Select type,name from sysobjects
  2879.    where type in ('P ','TR','U ','V ','X ')
  2880.    and   ObjectProperty(id, 'IsMSShipped') = 1
  2881.    order by type,name
  2882. Go
  2883. set nocount on
  2884. Go
  2885.  
  2886. use master
  2887. Go
  2888.  
  2889. Dump Transaction master with no_log
  2890. Go
  2891. Checkpoint
  2892. Go
  2893.  
  2894. print 'End of file.'
  2895. GO
  2896. -- - ----- EndOfFile
  2897.  
  2898.