
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
Go
/***********************************************************
DropAll.CQL 	 1996/03/25 15:06

      Pre-Drops to reduce possible space fragmentation, and to
avoid wasting time and space during DBCC UPGRADEDB.

      It is assumed this file is being run only thru ISQL.EXE,
and that the MS SQL Server allows ad-hoc catalog updates.

** Copyright Microsoft, Inc. 1994, 1995, 1996
** All Rights Reserved.
** Use, duplication, or disclosure by the United States Government
** is subject to restrictions as set forth in subdivision (c) (1) (ii)
** of the Rights in Technical Data and Computer Software clause
** at CFR 252.227-7013. Microsoft, Inc. One Microsoft Way, Redmond WA
** 98052.
***********************************************************/
Go

use master
set nocount on
Go

Dump Transaction master with no_log
Go
Checkpoint
Go

/***
   Make sure server was started in single user mode or that sp_configure
was used to enable updates to system tables.
***/

if (select value from syscurconfigs where config = 102) <> 1
        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.'
                        ,22,127) with log

Go

if object_id('tempdb..#prc_dropall_1') is not null
       drop procedure #prc_dropall_1
Go

create procedure #prc_dropall_1
as

set nocount on

Declare
       @sysobj_type           char(2)
      ,@sysobj_name           varchar(30)
      ,@count_1               integer
      ,@count_2               integer
      ,@dump_size             integer
      ,@dyn_cmd               varchar(127)

Select @dump_size = 25


select 'db_name()=',db_name()

Print 'Object type counts immediately prior to the drops:'

Select type ,count(*) as 'Count_10' from sysobjects
   where category & 2 <> 0
   group by type order by type

Print ' '


DECLARE
             csr_17_todrop
             insensitive
             Cursor For
   SELECT
             sysobj.type
            ,sysobj.name
      from
             sysobjects    sysobj
      where  sysobj.category & 2 <> 0
      order by
             sysobj.type
            ,sysobj.name
   FOR read only


Open csr_17_todrop


Select @count_1=0 ,@count_2=0


WHILE (17=17)
   begin

   FETCH        next
      from      csr_17_todrop
      into      @sysobj_type
               ,@sysobj_name

   if (@@fetch_status <> 0)
      begin
      Deallocate csr_17_todrop
      BREAK
      end

   select @count_1 = @count_1 + 1

   if (@count_1 % (@dump_size) = 0)
      begin
      select @count_2 = @count_2 + @count_1
      raiserror('So far %d Microsoft supplied sysobjects have been dropped.',0,1,@count_2) with nowait
      select @count_1=0
      dump transaction master with no_log
      end

   select @dyn_cmd = '/' + '* pre case init *' + '/'

   select @dyn_cmd =
            case @sysobj_type
               when 'P ' then 'drop procedure ' + @sysobj_name
               when 'U ' then 'drop table     ' + @sysobj_name
               when 'TR' then 'drop trigger   ' + @sysobj_name
               when 'V ' then 'drop view      ' + @sysobj_name
               when 'X ' then 'dbcc dropextendedproc(''' + @sysobj_name + ''')'
               else           '/' + '* Bypassing type=' +@sysobj_type+
                              ' name=' +@sysobj_name+ ' *' + '/'
            end


   if (@sysobj_type = 'U ')  --Might contain user data.
      begin

      if NOT (@sysobj_name in (  --Only these 'U ' can be dropped.

             'spt_values' ,'spt_monitor' ,'spt_committab'
            ,'spt_datatype_info' ,'spt_datatype_info_ext'
            ,'spt_server_info'
                              )
             )
         begin
         raiserror('/* Bypassing type=%s name=%s, to avoid loss of user data. */'
                  ,0,1,@sysobj_type,@sysobj_name)
         CONTINUE
         end
      end

   print   @dyn_cmd
   EXECUTE(@dyn_cmd)

   end -- loop 17


Print ' '
Print 'Object type counts immediately after dynamic drop logic:'

Select type,count(*) 'Count_30' from sysobjects
   where category & 2 <> 0
   group by type order by type

Print ' '
--End of #prc_dropall_1 creation...
Go

------------------------  Run drops in some databases  --------------

use master
go
execute #prc_dropall_1
go

declare @dbname varchar(30)
select  @dbname = 'msdb'

if exists (select * from master..sysdatabases where name=@dbname)
   begin
   execute('use ' +@dbname+ ' exec #prc_dropall_1')
   end

Go

use master

Go

if object_id('tempdb..#prc_dropall_1') is not null
       drop procedure #prc_dropall_1
Go

---------- Special cases, and Hardcoded cases  -------------------

Go

if exists (select * from sysobjects where type='P ' and name='sp_dbcoalesce')
	begin
	print 'Dropping procedure sp_dbcoalesce (obsolete in MS SQL 6.5) ...'
	drop procedure sp_dbcoalesce
	end
else
	begin
	print 'Nonexistent is procedure sp_dbcoalesce.'
	end


-- Above were special cases.
Print ' '
Go

if exists (select * from sysobjects where type='P ' and name='MS_sqlctrs_users')
	begin
	print 'Dropping procedure MS_sqlctrs_users ...'
	drop procedure MS_sqlctrs_users
	end
else
	begin
	print 'Nonexistent is procedure MS_sqlctrs_users.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_a_count_bits_on')
	begin
	print 'Dropping procedure sp_a_count_bits_on ...'
	drop procedure sp_a_count_bits_on
	end
else
	begin
	print 'Nonexistent is procedure sp_a_count_bits_on.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_abort_xact')
	begin
	print 'Dropping procedure sp_abort_xact ...'
	drop procedure sp_abort_xact
	end
else
	begin
	print 'Nonexistent is procedure sp_abort_xact.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_addalias')
	begin
	print 'Dropping procedure sp_addalias ...'
	drop procedure sp_addalias
	end
else
	begin
	print 'Nonexistent is procedure sp_addalias.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_addarticle')
	begin
	print 'Dropping procedure sp_addarticle ...'
	drop procedure sp_addarticle
	end
else
	begin
	print 'Nonexistent is procedure sp_addarticle.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_addextendedproc')
	begin
	print 'Dropping procedure sp_addextendedproc ...'
	drop procedure sp_addextendedproc
	end
else
	begin
	print 'Nonexistent is procedure sp_addextendedproc.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_addgroup')
	begin
	print 'Dropping procedure sp_addgroup ...'
	drop procedure sp_addgroup
	end
else
	begin
	print 'Nonexistent is procedure sp_addgroup.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_addlanguage')
	begin
	print 'Dropping procedure sp_addlanguage ...'
	drop procedure sp_addlanguage
	end
else
	begin
	print 'Nonexistent is procedure sp_addlanguage.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_addlogin')
	begin
	print 'Dropping procedure sp_addlogin ...'
	drop procedure sp_addlogin
	end
else
	begin
	print 'Nonexistent is procedure sp_addlogin.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_addmessage')
	begin
	print 'Dropping procedure sp_addmessage ...'
	drop procedure sp_addmessage
	end
else
	begin
	print 'Nonexistent is procedure sp_addmessage.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_addpublication')
	begin
	print 'Dropping procedure sp_addpublication ...'
	drop procedure sp_addpublication
	end
else
	begin
	print 'Nonexistent is procedure sp_addpublication.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_addpublisher')
	begin
	print 'Dropping procedure sp_addpublisher ...'
	drop procedure sp_addpublisher
	end
else
	begin
	print 'Nonexistent is procedure sp_addpublisher.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_addremotelogin')
	begin
	print 'Dropping procedure sp_addremotelogin ...'
	drop procedure sp_addremotelogin
	end
else
	begin
	print 'Nonexistent is procedure sp_addremotelogin.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_addsegment')
	begin
	print 'Dropping procedure sp_addsegment ...'
	drop procedure sp_addsegment
	end
else
	begin
	print 'Nonexistent is procedure sp_addsegment.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_addserver')
	begin
	print 'Dropping procedure sp_addserver ...'
	drop procedure sp_addserver
	end
else
	begin
	print 'Nonexistent is procedure sp_addserver.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_addsubscriber')
	begin
	print 'Dropping procedure sp_addsubscriber ...'
	drop procedure sp_addsubscriber
	end
else
	begin
	print 'Nonexistent is procedure sp_addsubscriber.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_addsubscription')
	begin
	print 'Dropping procedure sp_addsubscription ...'
	drop procedure sp_addsubscription
	end
else
	begin
	print 'Nonexistent is procedure sp_addsubscription.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_addtype')
	begin
	print 'Dropping procedure sp_addtype ...'
	drop procedure sp_addtype
	end
else
	begin
	print 'Nonexistent is procedure sp_addtype.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_addumpdevice')
	begin
	print 'Dropping procedure sp_addumpdevice ...'
	drop procedure sp_addumpdevice
	end
else
	begin
	print 'Nonexistent is procedure sp_addumpdevice.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_adduser')
	begin
	print 'Dropping procedure sp_adduser ...'
	drop procedure sp_adduser
	end
else
	begin
	print 'Nonexistent is procedure sp_adduser.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_altermessage')
	begin
	print 'Dropping procedure sp_altermessage ...'
	drop procedure sp_altermessage
	end
else
	begin
	print 'Nonexistent is procedure sp_altermessage.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_articlecolumn')
	begin
	print 'Dropping procedure sp_articlecolumn ...'
	drop procedure sp_articlecolumn
	end
else
	begin
	print 'Nonexistent is procedure sp_articlecolumn.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_articlefilter')
	begin
	print 'Dropping procedure sp_articlefilter ...'
	drop procedure sp_articlefilter
	end
else
	begin
	print 'Nonexistent is procedure sp_articlefilter.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_articletextcol')
	begin
	print 'Dropping procedure sp_articletextcol ...'
	drop procedure sp_articletextcol
	end
else
	begin
	print 'Nonexistent is procedure sp_articletextcol.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_articleview')
	begin
	print 'Dropping procedure sp_articleview ...'
	drop procedure sp_articleview
	end
else
	begin
	print 'Nonexistent is procedure sp_articleview.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_bindefault')
	begin
	print 'Dropping procedure sp_bindefault ...'
	drop procedure sp_bindefault
	end
else
	begin
	print 'Nonexistent is procedure sp_bindefault.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_bindrule')
	begin
	print 'Dropping procedure sp_bindrule ...'
	drop procedure sp_bindrule
	end
else
	begin
	print 'Nonexistent is procedure sp_bindrule.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_blockcnt')
	begin
	print 'Dropping procedure sp_blockcnt ...'
	drop procedure sp_blockcnt
	end
else
	begin
	print 'Nonexistent is procedure sp_blockcnt.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_certify_removable')
	begin
	print 'Dropping procedure sp_certify_removable ...'
	drop procedure sp_certify_removable
	end
else
	begin
	print 'Nonexistent is procedure sp_certify_removable.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_change_configstatus')
	begin
	print 'Dropping procedure sp_change_configstatus ...'
	drop procedure sp_change_configstatus
	end
else
	begin
	print 'Nonexistent is procedure sp_change_configstatus.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_change_users_login')
	begin
	print 'Dropping procedure sp_change_users_login ...'
	drop procedure sp_change_users_login
	end
else
	begin
	print 'Nonexistent is procedure sp_change_users_login.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_changearticle')
	begin
	print 'Dropping procedure sp_changearticle ...'
	drop procedure sp_changearticle
	end
else
	begin
	print 'Nonexistent is procedure sp_changearticle.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_changedbowner')
	begin
	print 'Dropping procedure sp_changedbowner ...'
	drop procedure sp_changedbowner
	end
else
	begin
	print 'Nonexistent is procedure sp_changedbowner.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_changegroup')
	begin
	print 'Dropping procedure sp_changegroup ...'
	drop procedure sp_changegroup
	end
else
	begin
	print 'Nonexistent is procedure sp_changegroup.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_changepublication')
	begin
	print 'Dropping procedure sp_changepublication ...'
	drop procedure sp_changepublication
	end
else
	begin
	print 'Nonexistent is procedure sp_changepublication.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_changesubscriber')
	begin
	print 'Dropping procedure sp_changesubscriber ...'
	drop procedure sp_changesubscriber
	end
else
	begin
	print 'Nonexistent is procedure sp_changesubscriber.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_changesubscription')
	begin
	print 'Dropping procedure sp_changesubscription ...'
	drop procedure sp_changesubscription
	end
else
	begin
	print 'Nonexistent is procedure sp_changesubscription.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_changesubstatus')
	begin
	print 'Dropping procedure sp_changesubstatus ...'
	drop procedure sp_changesubstatus
	end
else
	begin
	print 'Nonexistent is procedure sp_changesubstatus.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_check_objects')
	begin
	print 'Dropping procedure sp_check_objects ...'
	drop procedure sp_check_objects
	end
else
	begin
	print 'Nonexistent is procedure sp_check_objects.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_check_removable')
	begin
	print 'Dropping procedure sp_check_removable ...'
	drop procedure sp_check_removable
	end
else
	begin
	print 'Nonexistent is procedure sp_check_removable.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_checknames')
	begin
	print 'Dropping procedure sp_checknames ...'
	drop procedure sp_checknames
	end
else
	begin
	print 'Nonexistent is procedure sp_checknames.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_chklangparam')
	begin
	print 'Dropping procedure sp_chklangparam ...'
	drop procedure sp_chklangparam
	end
else
	begin
	print 'Nonexistent is procedure sp_chklangparam.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_coalesce_fragments')
	begin
	print 'Dropping procedure sp_coalesce_fragments ...'
	drop procedure sp_coalesce_fragments
	end
else
	begin
	print 'Nonexistent is procedure sp_coalesce_fragments.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_column_privileges')
	begin
	print 'Dropping procedure sp_column_privileges ...'
	drop procedure sp_column_privileges
	end
else
	begin
	print 'Nonexistent is procedure sp_column_privileges.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_columns')
	begin
	print 'Dropping procedure sp_columns ...'
	drop procedure sp_columns
	end
else
	begin
	print 'Nonexistent is procedure sp_columns.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_commit_xact')
	begin
	print 'Dropping procedure sp_commit_xact ...'
	drop procedure sp_commit_xact
	end
else
	begin
	print 'Nonexistent is procedure sp_commit_xact.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_commonkey')
	begin
	print 'Dropping procedure sp_commonkey ...'
	drop procedure sp_commonkey
	end
else
	begin
	print 'Nonexistent is procedure sp_commonkey.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_configure')
	begin
	print 'Dropping procedure sp_configure ...'
	drop procedure sp_configure
	end
else
	begin
	print 'Nonexistent is procedure sp_configure.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_create_distribution_tables')
	begin
	print 'Dropping procedure sp_create_distribution_tables ...'
	drop procedure sp_create_distribution_tables
	end
else
	begin
	print 'Nonexistent is procedure sp_create_distribution_tables.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_create_removable')
	begin
	print 'Dropping procedure sp_create_removable ...'
	drop procedure sp_create_removable
	end
else
	begin
	print 'Nonexistent is procedure sp_create_removable.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_databases')
	begin
	print 'Dropping procedure sp_databases ...'
	drop procedure sp_databases
	end
else
	begin
	print 'Nonexistent is procedure sp_databases.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_datatype_info')
	begin
	print 'Dropping procedure sp_datatype_info ...'
	drop procedure sp_datatype_info
	end
else
	begin
	print 'Nonexistent is procedure sp_datatype_info.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_db_upgrade')
	begin
	print 'Dropping procedure sp_db_upgrade ...'
	drop procedure sp_db_upgrade
	end
else
	begin
	print 'Nonexistent is procedure sp_db_upgrade.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_db_upgrade1')
	begin
	print 'Dropping procedure sp_db_upgrade1 ...'
	drop procedure sp_db_upgrade1
	end
else
	begin
	print 'Nonexistent is procedure sp_db_upgrade1.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_db_upgrade2')
	begin
	print 'Dropping procedure sp_db_upgrade2 ...'
	drop procedure sp_db_upgrade2
	end
else
	begin
	print 'Nonexistent is procedure sp_db_upgrade2.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_dbinstall')
	begin
	print 'Dropping procedure sp_dbinstall ...'
	drop procedure sp_dbinstall
	end
else
	begin
	print 'Nonexistent is procedure sp_dbinstall.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_dboption')
	begin
	print 'Dropping procedure sp_dboption ...'
	drop procedure sp_dboption
	end
else
	begin
	print 'Nonexistent is procedure sp_dboption.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_dbremove')
	begin
	print 'Dropping procedure sp_dbremove ...'
	drop procedure sp_dbremove
	end
else
	begin
	print 'Nonexistent is procedure sp_dbremove.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_ddopen')
	begin
	print 'Dropping procedure sp_ddopen ...'
	drop procedure sp_ddopen
	end
else
	begin
	print 'Nonexistent is procedure sp_ddopen.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_defaultdb')
	begin
	print 'Dropping procedure sp_defaultdb ...'
	drop procedure sp_defaultdb
	end
else
	begin
	print 'Nonexistent is procedure sp_defaultdb.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_defaultlanguage')
	begin
	print 'Dropping procedure sp_defaultlanguage ...'
	drop procedure sp_defaultlanguage
	end
else
	begin
	print 'Nonexistent is procedure sp_defaultlanguage.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_depends')
	begin
	print 'Dropping procedure sp_depends ...'
	drop procedure sp_depends
	end
else
	begin
	print 'Nonexistent is procedure sp_depends.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_devcreate')
	begin
	print 'Dropping procedure sp_devcreate ...'
	drop procedure sp_devcreate
	end
else
	begin
	print 'Nonexistent is procedure sp_devcreate.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_devoption')
	begin
	print 'Dropping procedure sp_devoption ...'
	drop procedure sp_devoption
	end
else
	begin
	print 'Nonexistent is procedure sp_devoption.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_diskdefault')
	begin
	print 'Dropping procedure sp_diskdefault ...'
	drop procedure sp_diskdefault
	end
else
	begin
	print 'Nonexistent is procedure sp_diskdefault.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_distcounters')
	begin
	print 'Dropping procedure sp_distcounters ...'
	drop procedure sp_distcounters
	end
else
	begin
	print 'Nonexistent is procedure sp_distcounters.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_dropalias')
	begin
	print 'Dropping procedure sp_dropalias ...'
	drop procedure sp_dropalias
	end
else
	begin
	print 'Nonexistent is procedure sp_dropalias.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_droparticle')
	begin
	print 'Dropping procedure sp_droparticle ...'
	drop procedure sp_droparticle
	end
else
	begin
	print 'Nonexistent is procedure sp_droparticle.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_dropdevice')
	begin
	print 'Dropping procedure sp_dropdevice ...'
	drop procedure sp_dropdevice
	end
else
	begin
	print 'Nonexistent is procedure sp_dropdevice.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_dropextendedproc')
	begin
	print 'Dropping procedure sp_dropextendedproc ...'
	drop procedure sp_dropextendedproc
	end
else
	begin
	print 'Nonexistent is procedure sp_dropextendedproc.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_dropgroup')
	begin
	print 'Dropping procedure sp_dropgroup ...'
	drop procedure sp_dropgroup
	end
else
	begin
	print 'Nonexistent is procedure sp_dropgroup.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_dropkey')
	begin
	print 'Dropping procedure sp_dropkey ...'
	drop procedure sp_dropkey
	end
else
	begin
	print 'Nonexistent is procedure sp_dropkey.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_droplanguage')
	begin
	print 'Dropping procedure sp_droplanguage ...'
	drop procedure sp_droplanguage
	end
else
	begin
	print 'Nonexistent is procedure sp_droplanguage.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_droplogin')
	begin
	print 'Dropping procedure sp_droplogin ...'
	drop procedure sp_droplogin
	end
else
	begin
	print 'Nonexistent is procedure sp_droplogin.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_dropmessage')
	begin
	print 'Dropping procedure sp_dropmessage ...'
	drop procedure sp_dropmessage
	end
else
	begin
	print 'Nonexistent is procedure sp_dropmessage.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_droppublication')
	begin
	print 'Dropping procedure sp_droppublication ...'
	drop procedure sp_droppublication
	end
else
	begin
	print 'Nonexistent is procedure sp_droppublication.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_droppublisher')
	begin
	print 'Dropping procedure sp_droppublisher ...'
	drop procedure sp_droppublisher
	end
else
	begin
	print 'Nonexistent is procedure sp_droppublisher.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_dropremotelogin')
	begin
	print 'Dropping procedure sp_dropremotelogin ...'
	drop procedure sp_dropremotelogin
	end
else
	begin
	print 'Nonexistent is procedure sp_dropremotelogin.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_dropsegment')
	begin
	print 'Dropping procedure sp_dropsegment ...'
	drop procedure sp_dropsegment
	end
else
	begin
	print 'Nonexistent is procedure sp_dropsegment.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_dropserver')
	begin
	print 'Dropping procedure sp_dropserver ...'
	drop procedure sp_dropserver
	end
else
	begin
	print 'Nonexistent is procedure sp_dropserver.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_dropsubscriber')
	begin
	print 'Dropping procedure sp_dropsubscriber ...'
	drop procedure sp_dropsubscriber
	end
else
	begin
	print 'Nonexistent is procedure sp_dropsubscriber.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_dropsubscription')
	begin
	print 'Dropping procedure sp_dropsubscription ...'
	drop procedure sp_dropsubscription
	end
else
	begin
	print 'Nonexistent is procedure sp_dropsubscription.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_droptype')
	begin
	print 'Dropping procedure sp_droptype ...'
	drop procedure sp_droptype
	end
else
	begin
	print 'Nonexistent is procedure sp_droptype.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_dropuser')
	begin
	print 'Dropping procedure sp_dropuser ...'
	drop procedure sp_dropuser
	end
else
	begin
	print 'Nonexistent is procedure sp_dropuser.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_dsninfo')
	begin
	print 'Dropping procedure sp_dsninfo ...'
	drop procedure sp_dsninfo
	end
else
	begin
	print 'Nonexistent is procedure sp_dsninfo.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_enumdsn')
	begin
	print 'Dropping procedure sp_enumdsn ...'
	drop procedure sp_enumdsn
	end
else
	begin
	print 'Nonexistent is procedure sp_enumdsn.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_enumfullsubscribers')
	begin
	print 'Dropping procedure sp_enumfullsubscribers ...'
	drop procedure sp_enumfullsubscribers
	end
else
	begin
	print 'Nonexistent is procedure sp_enumfullsubscribers.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_extendsegment')
	begin
	print 'Dropping procedure sp_extendsegment ...'
	drop procedure sp_extendsegment
	end
else
	begin
	print 'Nonexistent is procedure sp_extendsegment.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_fixindex')
	begin
	print 'Dropping procedure sp_fixindex ...'
	drop procedure sp_fixindex
	end
else
	begin
	print 'Nonexistent is procedure sp_fixindex.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_fkeys')
	begin
	print 'Dropping procedure sp_fkeys ...'
	drop procedure sp_fkeys
	end
else
	begin
	print 'Nonexistent is procedure sp_fkeys.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_foreignkey')
	begin
	print 'Dropping procedure sp_foreignkey ...'
	drop procedure sp_foreignkey
	end
else
	begin
	print 'Nonexistent is procedure sp_foreignkey.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_get_volume_label')
	begin
	print 'Dropping procedure sp_get_volume_label ...'
	drop procedure sp_get_volume_label
	end
else
	begin
	print 'Nonexistent is procedure sp_get_volume_label.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_hcchangesubstatus1')
	begin
	print 'Dropping procedure sp_hcchangesubstatus1 ...'
	drop procedure sp_hcchangesubstatus1
	end
else
	begin
	print 'Nonexistent is procedure sp_hcchangesubstatus1.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_hcchangesubstatus2')
	begin
	print 'Dropping procedure sp_hcchangesubstatus2 ...'
	drop procedure sp_hcchangesubstatus2
	end
else
	begin
	print 'Nonexistent is procedure sp_hcchangesubstatus2.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_help')
	begin
	print 'Dropping procedure sp_help ...'
	drop procedure sp_help
	end
else
	begin
	print 'Nonexistent is procedure sp_help.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_help_revdatabase')
	begin
	print 'Dropping procedure sp_help_revdatabase ...'
	drop procedure sp_help_revdatabase
	end
else
	begin
	print 'Nonexistent is procedure sp_help_revdatabase.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_help_setopts')
	begin
	print 'Dropping procedure sp_help_setopts ...'
	drop procedure sp_help_setopts
	end
else
	begin
	print 'Nonexistent is procedure sp_help_setopts.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helparticle')
	begin
	print 'Dropping procedure sp_helparticle ...'
	drop procedure sp_helparticle
	end
else
	begin
	print 'Nonexistent is procedure sp_helparticle.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helparticlecolumns')
	begin
	print 'Dropping procedure sp_helparticlecolumns ...'
	drop procedure sp_helparticlecolumns
	end
else
	begin
	print 'Nonexistent is procedure sp_helparticlecolumns.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helpconstraint')
	begin
	print 'Dropping procedure sp_helpconstraint ...'
	drop procedure sp_helpconstraint
	end
else
	begin
	print 'Nonexistent is procedure sp_helpconstraint.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_helpdb')
	begin
	print 'Dropping procedure sp_helpdb ...'
	drop procedure sp_helpdb
	end
else
	begin
	print 'Nonexistent is procedure sp_helpdb.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helpdevice')
	begin
	print 'Dropping procedure sp_helpdevice ...'
	drop procedure sp_helpdevice
	end
else
	begin
	print 'Nonexistent is procedure sp_helpdevice.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helpdistributor')
	begin
	print 'Dropping procedure sp_helpdistributor ...'
	drop procedure sp_helpdistributor
	end
else
	begin
	print 'Nonexistent is procedure sp_helpdistributor.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helpextendedproc')
	begin
	print 'Dropping procedure sp_helpextendedproc ...'
	drop procedure sp_helpextendedproc
	end
else
	begin
	print 'Nonexistent is procedure sp_helpextendedproc.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helpgroup')
	begin
	print 'Dropping procedure sp_helpgroup ...'
	drop procedure sp_helpgroup
	end
else
	begin
	print 'Nonexistent is procedure sp_helpgroup.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_helpindex')
	begin
	print 'Dropping procedure sp_helpindex ...'
	drop procedure sp_helpindex
	end
else
	begin
	print 'Nonexistent is procedure sp_helpindex.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helpjoins')
	begin
	print 'Dropping procedure sp_helpjoins ...'
	drop procedure sp_helpjoins
	end
else
	begin
	print 'Nonexistent is procedure sp_helpjoins.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helpkey')
	begin
	print 'Dropping procedure sp_helpkey ...'
	drop procedure sp_helpkey
	end
else
	begin
	print 'Nonexistent is procedure sp_helpkey.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helplanguage')
	begin
	print 'Dropping procedure sp_helplanguage ...'
	drop procedure sp_helplanguage
	end
else
	begin
	print 'Nonexistent is procedure sp_helplanguage.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helplog')
	begin
	print 'Dropping procedure sp_helplog ...'
	drop procedure sp_helplog
	end
else
	begin
	print 'Nonexistent is procedure sp_helplog.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_helplogins')
	begin
	print 'Dropping procedure sp_helplogins ...'
	drop procedure sp_helplogins
	end
else
	begin
	print 'Nonexistent is procedure sp_helplogins.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helppublication')
	begin
	print 'Dropping procedure sp_helppublication ...'
	drop procedure sp_helppublication
	end
else
	begin
	print 'Nonexistent is procedure sp_helppublication.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helppublicationsync')
	begin
	print 'Dropping procedure sp_helppublicationsync ...'
	drop procedure sp_helppublicationsync
	end
else
	begin
	print 'Nonexistent is procedure sp_helppublicationsync.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helpremotelogin')
	begin
	print 'Dropping procedure sp_helpremotelogin ...'
	drop procedure sp_helpremotelogin
	end
else
	begin
	print 'Nonexistent is procedure sp_helpremotelogin.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helpreplicationdb')
	begin
	print 'Dropping procedure sp_helpreplicationdb ...'
	drop procedure sp_helpreplicationdb
	end
else
	begin
	print 'Nonexistent is procedure sp_helpreplicationdb.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_helprotect')
	begin
	print 'Dropping procedure sp_helprotect ...'
	drop procedure sp_helprotect
	end
else
	begin
	print 'Nonexistent is procedure sp_helprotect.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helpsegment')
	begin
	print 'Dropping procedure sp_helpsegment ...'
	drop procedure sp_helpsegment
	end
else
	begin
	print 'Nonexistent is procedure sp_helpsegment.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helpserver')
	begin
	print 'Dropping procedure sp_helpserver ...'
	drop procedure sp_helpserver
	end
else
	begin
	print 'Nonexistent is procedure sp_helpserver.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helpsort')
	begin
	print 'Dropping procedure sp_helpsort ...'
	drop procedure sp_helpsort
	end
else
	begin
	print 'Nonexistent is procedure sp_helpsort.'
	end


Print 'Bypassing procedure sp_helpsql.'
Go

if exists (select * from sysobjects where type='P ' and name='sp_helpstartup')
	begin
	print 'Dropping procedure sp_helpstartup ...'
	drop procedure sp_helpstartup
	end
else
	begin
	print 'Nonexistent is procedure sp_helpstartup.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helpsubscriberinfo')
	begin
	print 'Dropping procedure sp_helpsubscriberinfo ...'
	drop procedure sp_helpsubscriberinfo
	end
else
	begin
	print 'Nonexistent is procedure sp_helpsubscriberinfo.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helpsubscription')
	begin
	print 'Dropping procedure sp_helpsubscription ...'
	drop procedure sp_helpsubscription
	end
else
	begin
	print 'Nonexistent is procedure sp_helpsubscription.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helptext')
	begin
	print 'Dropping procedure sp_helptext ...'
	drop procedure sp_helptext
	end
else
	begin
	print 'Nonexistent is procedure sp_helptext.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_helpuser')
	begin
	print 'Dropping procedure sp_helpuser ...'
	drop procedure sp_helpuser
	end
else
	begin
	print 'Nonexistent is procedure sp_helpuser.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_lock')
	begin
	print 'Dropping procedure sp_lock ...'
	drop procedure sp_lock
	end
else
	begin
	print 'Nonexistent is procedure sp_lock.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_lock2')
	begin
	print 'Dropping procedure sp_lock2 ...'
	drop procedure sp_lock2
	end
else
	begin
	print 'Nonexistent is procedure sp_lock2.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_lockinfo')
	begin
	print 'Dropping procedure sp_lockinfo ...'
	drop procedure sp_lockinfo
	end
else
	begin
	print 'Nonexistent is procedure sp_lockinfo.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_logdevice')
	begin
	print 'Dropping procedure sp_logdevice ...'
	drop procedure sp_logdevice
	end
else
	begin
	print 'Nonexistent is procedure sp_logdevice.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_lookup')
	begin
	print 'Dropping procedure sp_lookup ...'
	drop procedure sp_lookup
	end
else
	begin
	print 'Nonexistent is procedure sp_lookup.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_makestartup')
	begin
	print 'Dropping procedure sp_makestartup ...'
	drop procedure sp_makestartup
	end
else
	begin
	print 'Nonexistent is procedure sp_makestartup.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_makewebpage')
	begin
	print 'Dropping procedure sp_makewebpage ...'
	drop procedure sp_makewebpage
	end
else
	begin
	print 'Nonexistent is procedure sp_makewebpage.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_markreport')
	begin
	print 'Dropping procedure sp_markreport ...'
	drop procedure sp_markreport
	end
else
	begin
	print 'Nonexistent is procedure sp_markreport.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_monitor')
	begin
	print 'Dropping procedure sp_monitor ...'
	drop procedure sp_monitor
	end
else
	begin
	print 'Nonexistent is procedure sp_monitor.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MSdbuserprofile')
	begin
	print 'Dropping procedure sp_MSdbuserprofile ...'
	drop procedure sp_MSdbuserprofile
	end
else
	begin
	print 'Nonexistent is procedure sp_MSdbuserprofile.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_MSdependencies')
	begin
	print 'Dropping procedure sp_MSdependencies ...'
	drop procedure sp_MSdependencies
	end
else
	begin
	print 'Nonexistent is procedure sp_MSdependencies.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MSfilterclause')
	begin
	print 'Dropping procedure sp_MSfilterclause ...'
	drop procedure sp_MSfilterclause
	end
else
	begin
	print 'Nonexistent is procedure sp_MSfilterclause.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MSforeach_worker')
	begin
	print 'Dropping procedure sp_MSforeach_worker ...'
	drop procedure sp_MSforeach_worker
	end
else
	begin
	print 'Nonexistent is procedure sp_MSforeach_worker.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MSforeachdb')
	begin
	print 'Dropping procedure sp_MSforeachdb ...'
	drop procedure sp_MSforeachdb
	end
else
	begin
	print 'Nonexistent is procedure sp_MSforeachdb.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MSforeachtable')
	begin
	print 'Dropping procedure sp_MSforeachtable ...'
	drop procedure sp_MSforeachtable
	end
else
	begin
	print 'Nonexistent is procedure sp_MSforeachtable.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_MSgetalertinfo')
	begin
	print 'Dropping procedure sp_MSgetalertinfo ...'
	drop procedure sp_MSgetalertinfo
	end
else
	begin
	print 'Nonexistent is procedure sp_MSgetalertinfo.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MSgetexecinfo')
	begin
	print 'Dropping procedure sp_MSgetexecinfo ...'
	drop procedure sp_MSgetexecinfo
	end
else
	begin
	print 'Nonexistent is procedure sp_MSgetexecinfo.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MShelpcolumns')
	begin
	print 'Dropping procedure sp_MShelpcolumns ...'
	drop procedure sp_MShelpcolumns
	end
else
	begin
	print 'Nonexistent is procedure sp_MShelpcolumns.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MShelpindex')
	begin
	print 'Dropping procedure sp_MShelpindex ...'
	drop procedure sp_MShelpindex
	end
else
	begin
	print 'Nonexistent is procedure sp_MShelpindex.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MShelptype')
	begin
	print 'Dropping procedure sp_MShelptype ...'
	drop procedure sp_MShelptype
	end
else
	begin
	print 'Nonexistent is procedure sp_MShelptype.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_MSindexspace')
	begin
	print 'Dropping procedure sp_MSindexspace ...'
	drop procedure sp_MSindexspace
	end
else
	begin
	print 'Nonexistent is procedure sp_MSindexspace.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MSkilldb')
	begin
	print 'Dropping procedure sp_MSkilldb ...'
	drop procedure sp_MSkilldb
	end
else
	begin
	print 'Nonexistent is procedure sp_MSkilldb.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MSloginmappings')
	begin
	print 'Dropping procedure sp_MSloginmappings ...'
	drop procedure sp_MSloginmappings
	end
else
	begin
	print 'Nonexistent is procedure sp_MSloginmappings.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MSmatchkey')
	begin
	print 'Dropping procedure sp_MSmatchkey ...'
	drop procedure sp_MSmatchkey
	end
else
	begin
	print 'Nonexistent is procedure sp_MSmatchkey.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MSobjectprivs')
	begin
	print 'Dropping procedure sp_MSobjectprivs ...'
	drop procedure sp_MSobjectprivs
	end
else
	begin
	print 'Nonexistent is procedure sp_MSobjectprivs.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_MSsetalertinfo')
	begin
	print 'Dropping procedure sp_MSsetalertinfo ...'
	drop procedure sp_MSsetalertinfo
	end
else
	begin
	print 'Nonexistent is procedure sp_MSsetalertinfo.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MSsetexecinfo')
	begin
	print 'Dropping procedure sp_MSsetexecinfo ...'
	drop procedure sp_MSsetexecinfo
	end
else
	begin
	print 'Nonexistent is procedure sp_MSsetexecinfo.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MSsettopology')
	begin
	print 'Dropping procedure sp_MSsettopology ...'
	drop procedure sp_MSsettopology
	end
else
	begin
	print 'Nonexistent is procedure sp_MSsettopology.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MSSQLOLE_version')
	begin
	print 'Dropping procedure sp_MSSQLOLE_version ...'
	drop procedure sp_MSSQLOLE_version
	end
else
	begin
	print 'Nonexistent is procedure sp_MSSQLOLE_version.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MSsubscriptions')
	begin
	print 'Dropping procedure sp_MSsubscriptions ...'
	drop procedure sp_MSsubscriptions
	end
else
	begin
	print 'Nonexistent is procedure sp_MSsubscriptions.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_MStablechecks')
	begin
	print 'Dropping procedure sp_MStablechecks ...'
	drop procedure sp_MStablechecks
	end
else
	begin
	print 'Nonexistent is procedure sp_MStablechecks.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MStablekeys')
	begin
	print 'Dropping procedure sp_MStablekeys ...'
	drop procedure sp_MStablekeys
	end
else
	begin
	print 'Nonexistent is procedure sp_MStablekeys.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MStablerefs')
	begin
	print 'Dropping procedure sp_MStablerefs ...'
	drop procedure sp_MStablerefs
	end
else
	begin
	print 'Nonexistent is procedure sp_MStablerefs.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MStablespace')
	begin
	print 'Dropping procedure sp_MStablespace ...'
	drop procedure sp_MStablespace
	end
else
	begin
	print 'Nonexistent is procedure sp_MStablespace.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MSuniquename')
	begin
	print 'Dropping procedure sp_MSuniquename ...'
	drop procedure sp_MSuniquename
	end
else
	begin
	print 'Nonexistent is procedure sp_MSuniquename.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_namecrack')
	begin
	print 'Dropping procedure sp_namecrack ...'
	drop procedure sp_namecrack
	end
else
	begin
	print 'Nonexistent is procedure sp_namecrack.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_objcheck')
	begin
	print 'Dropping procedure sp_objcheck ...'
	drop procedure sp_objcheck
	end
else
	begin
	print 'Nonexistent is procedure sp_objcheck.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_objectsegment')
	begin
	print 'Dropping procedure sp_objectsegment ...'
	drop procedure sp_objectsegment
	end
else
	begin
	print 'Nonexistent is procedure sp_objectsegment.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_password')
	begin
	print 'Dropping procedure sp_password ...'
	drop procedure sp_password
	end
else
	begin
	print 'Nonexistent is procedure sp_password.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_pkeys')
	begin
	print 'Dropping procedure sp_pkeys ...'
	drop procedure sp_pkeys
	end
else
	begin
	print 'Nonexistent is procedure sp_pkeys.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_placeobject')
	begin
	print 'Dropping procedure sp_placeobject ...'
	drop procedure sp_placeobject
	end
else
	begin
	print 'Nonexistent is procedure sp_placeobject.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_primarykey')
	begin
	print 'Dropping procedure sp_primarykey ...'
	drop procedure sp_primarykey
	end
else
	begin
	print 'Nonexistent is procedure sp_primarykey.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_probe_xact')
	begin
	print 'Dropping procedure sp_probe_xact ...'
	drop procedure sp_probe_xact
	end
else
	begin
	print 'Nonexistent is procedure sp_probe_xact.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_processinfo')
	begin
	print 'Dropping procedure sp_processinfo ...'
	drop procedure sp_processinfo
	end
else
	begin
	print 'Nonexistent is procedure sp_processinfo.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_processmail')
	begin
	print 'Dropping procedure sp_processmail ...'
	drop procedure sp_processmail
	end
else
	begin
	print 'Nonexistent is procedure sp_processmail.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_publishdb')
	begin
	print 'Dropping procedure sp_publishdb ...'
	drop procedure sp_publishdb
	end
else
	begin
	print 'Nonexistent is procedure sp_publishdb.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_recompile')
	begin
	print 'Dropping procedure sp_recompile ...'
	drop procedure sp_recompile
	end
else
	begin
	print 'Nonexistent is procedure sp_recompile.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_remoteoption')
	begin
	print 'Dropping procedure sp_remoteoption ...'
	drop procedure sp_remoteoption
	end
else
	begin
	print 'Nonexistent is procedure sp_remoteoption.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_remove_xact')
	begin
	print 'Dropping procedure sp_remove_xact ...'
	drop procedure sp_remove_xact
	end
else
	begin
	print 'Nonexistent is procedure sp_remove_xact.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_rename')
	begin
	print 'Dropping procedure sp_rename ...'
	drop procedure sp_rename
	end
else
	begin
	print 'Nonexistent is procedure sp_rename.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_renamedb')
	begin
	print 'Dropping procedure sp_renamedb ...'
	drop procedure sp_renamedb
	end
else
	begin
	print 'Nonexistent is procedure sp_renamedb.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_replica')
	begin
	print 'Dropping procedure sp_replica ...'
	drop procedure sp_replica
	end
else
	begin
	print 'Nonexistent is procedure sp_replica.'
	end

if exists (select * from sysobjects where type='P ' and name='sp_scan_xact')
	begin
	print 'Dropping procedure sp_scan_xact ...'
	drop procedure sp_scan_xact
	end
else
	begin
	print 'Nonexistent is procedure sp_scan_xact.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_schedulersignal')
	begin
	print 'Dropping procedure sp_schedulersignal ...'
	drop procedure sp_schedulersignal
	end
else
	begin
	print 'Nonexistent is procedure sp_schedulersignal.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_seguse')
	begin
	print 'Dropping procedure sp_seguse ...'
	drop procedure sp_seguse
	end
else
	begin
	print 'Nonexistent is procedure sp_seguse.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_server_info')
	begin
	print 'Dropping procedure sp_server_info ...'
	drop procedure sp_server_info
	end
else
	begin
	print 'Nonexistent is procedure sp_server_info.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_serveroption')
	begin
	print 'Dropping procedure sp_serveroption ...'
	drop procedure sp_serveroption
	end
else
	begin
	print 'Nonexistent is procedure sp_serveroption.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_setlangalias')
	begin
	print 'Dropping procedure sp_setlangalias ...'
	drop procedure sp_setlangalias
	end
else
	begin
	print 'Nonexistent is procedure sp_setlangalias.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_setnetname')
	begin
	print 'Dropping procedure sp_setnetname ...'
	drop procedure sp_setnetname
	end
else
	begin
	print 'Nonexistent is procedure sp_setnetname.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_spaceused')
	begin
	print 'Dropping procedure sp_spaceused ...'
	drop procedure sp_spaceused
	end
else
	begin
	print 'Nonexistent is procedure sp_spaceused.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_special_columns')
	begin
	print 'Dropping procedure sp_special_columns ...'
	drop procedure sp_special_columns
	end
else
	begin
	print 'Nonexistent is procedure sp_special_columns.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_sproc_columns')
	begin
	print 'Dropping procedure sp_sproc_columns ...'
	drop procedure sp_sproc_columns
	end
else
	begin
	print 'Nonexistent is procedure sp_sproc_columns.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_sqlexec')
	begin
	print 'Dropping procedure sp_sqlexec ...'
	drop procedure sp_sqlexec
	end
else
	begin
	print 'Nonexistent is procedure sp_sqlexec.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_sqlregister')
	begin
	print 'Dropping procedure sp_sqlregister ...'
	drop procedure sp_sqlregister
	end
else
	begin
	print 'Nonexistent is procedure sp_sqlregister.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_start_xact')
	begin
	print 'Dropping procedure sp_start_xact ...'
	drop procedure sp_start_xact
	end
else
	begin
	print 'Nonexistent is procedure sp_start_xact.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_stat_xact')
	begin
	print 'Dropping procedure sp_stat_xact ...'
	drop procedure sp_stat_xact
	end
else
	begin
	print 'Nonexistent is procedure sp_stat_xact.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_statistics')
	begin
	print 'Dropping procedure sp_statistics ...'
	drop procedure sp_statistics
	end
else
	begin
	print 'Nonexistent is procedure sp_statistics.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_stored_procedures')
	begin
	print 'Dropping procedure sp_stored_procedures ...'
	drop procedure sp_stored_procedures
	end
else
	begin
	print 'Nonexistent is procedure sp_stored_procedures.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_subscribe')
	begin
	print 'Dropping procedure sp_subscribe ...'
	drop procedure sp_subscribe
	end
else
	begin
	print 'Nonexistent is procedure sp_subscribe.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_table_privileges')
	begin
	print 'Dropping procedure sp_table_privileges ...'
	drop procedure sp_table_privileges
	end
else
	begin
	print 'Nonexistent is procedure sp_table_privileges.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_tables')
	begin
	print 'Dropping procedure sp_tables ...'
	drop procedure sp_tables
	end
else
	begin
	print 'Nonexistent is procedure sp_tables.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_tempdbspace')
	begin
	print 'Dropping procedure sp_tempdbspace ...'
	drop procedure sp_tempdbspace
	end
else
	begin
	print 'Nonexistent is procedure sp_tempdbspace.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_textcolstatus')
	begin
	print 'Dropping procedure sp_textcolstatus ...'
	drop procedure sp_textcolstatus
	end
else
	begin
	print 'Nonexistent is procedure sp_textcolstatus.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_tphelp')
	begin
	print 'Dropping procedure sp_tphelp ...'
	drop procedure sp_tphelp
	end
else
	begin
	print 'Nonexistent is procedure sp_tphelp.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_tphelp2')
	begin
	print 'Dropping procedure sp_tphelp2 ...'
	drop procedure sp_tphelp2
	end
else
	begin
	print 'Nonexistent is procedure sp_tphelp2.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_unbindefault')
	begin
	print 'Dropping procedure sp_unbindefault ...'
	drop procedure sp_unbindefault
	end
else
	begin
	print 'Nonexistent is procedure sp_unbindefault.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_MSuninstall_publishing')
	begin
	print 'Dropping procedure sp_MSuninstall_publishing ...'
	drop procedure sp_MSuninstall_publishing
	end
else
	begin
	print 'Nonexistent is procedure sp_MSuninstall_publishing.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_unbindrule')
	begin
	print 'Dropping procedure sp_unbindrule ...'
	drop procedure sp_unbindrule
	end
else
	begin
	print 'Nonexistent is procedure sp_unbindrule.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_unmakestartup')
	begin
	print 'Dropping procedure sp_unmakestartup ...'
	drop procedure sp_unmakestartup
	end
else
	begin
	print 'Nonexistent is procedure sp_unmakestartup.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_unsubscribe')
	begin
	print 'Dropping procedure sp_unsubscribe ...'
	drop procedure sp_unsubscribe
	end
else
	begin
	print 'Nonexistent is procedure sp_unsubscribe.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_user_counter1')
	begin
	print 'Dropping procedure sp_user_counter1 ...'
	drop procedure sp_user_counter1
	end
else
	begin
	print 'Nonexistent is procedure sp_user_counter1.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_user_counter10')
	begin
	print 'Dropping procedure sp_user_counter10 ...'
	drop procedure sp_user_counter10
	end
else
	begin
	print 'Nonexistent is procedure sp_user_counter10.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_user_counter2')
	begin
	print 'Dropping procedure sp_user_counter2 ...'
	drop procedure sp_user_counter2
	end
else
	begin
	print 'Nonexistent is procedure sp_user_counter2.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_user_counter3')
	begin
	print 'Dropping procedure sp_user_counter3 ...'
	drop procedure sp_user_counter3
	end
else
	begin
	print 'Nonexistent is procedure sp_user_counter3.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_user_counter4')
	begin
	print 'Dropping procedure sp_user_counter4 ...'
	drop procedure sp_user_counter4
	end
else
	begin
	print 'Nonexistent is procedure sp_user_counter4.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='P ' and name='sp_user_counter5')
	begin
	print 'Dropping procedure sp_user_counter5 ...'
	drop procedure sp_user_counter5
	end
else
	begin
	print 'Nonexistent is procedure sp_user_counter5.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_user_counter6')
	begin
	print 'Dropping procedure sp_user_counter6 ...'
	drop procedure sp_user_counter6
	end
else
	begin
	print 'Nonexistent is procedure sp_user_counter6.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_user_counter7')
	begin
	print 'Dropping procedure sp_user_counter7 ...'
	drop procedure sp_user_counter7
	end
else
	begin
	print 'Nonexistent is procedure sp_user_counter7.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_user_counter8')
	begin
	print 'Dropping procedure sp_user_counter8 ...'
	drop procedure sp_user_counter8
	end
else
	begin
	print 'Nonexistent is procedure sp_user_counter8.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_user_counter9')
	begin
	print 'Dropping procedure sp_user_counter9 ...'
	drop procedure sp_user_counter9
	end
else
	begin
	print 'Nonexistent is procedure sp_user_counter9.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_userdefcounters')
	begin
	print 'Dropping procedure sp_userdefcounters ...'
	drop procedure sp_userdefcounters
	end
else
	begin
	print 'Nonexistent is procedure sp_userdefcounters.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_validlang')
	begin
	print 'Dropping procedure sp_validlang ...'
	drop procedure sp_validlang
	end
else
	begin
	print 'Nonexistent is procedure sp_validlang.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_validname')
	begin
	print 'Dropping procedure sp_validname ...'
	drop procedure sp_validname
	end
else
	begin
	print 'Nonexistent is procedure sp_validname.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_who')
	begin
	print 'Dropping procedure sp_who ...b'
	drop procedure sp_who
	end
else
	begin
	print 'Nonexistent is procedure sp_who.'
	end


if exists (select * from sysobjects where type='P ' and name='sp_who2')
	begin
	print 'Dropping procedure sp_who2 ...'
	drop procedure sp_who2
	end
else
	begin
	print 'Nonexistent is procedure sp_who2.'
	end

Go

if exists (select * from sysobjects where type='P ' and name='sp_xpoption')
	begin
	print 'Dropping procedure sp_xpoption ...'
	drop procedure sp_xpoption
	end
else
	begin
	print 'Nonexistent is procedure sp_xpoption.'
	end


Print 'Bypassing table helpsql.'


if exists (select * from sysobjects where type='U ' and name='MSobjects')
	begin
	print 'Dropping table MSobjects ...'
	drop table MSobjects
	end
else
	begin
	print 'Nonexistent is table MSobjects.'
	end


Go

if exists (select * from sysobjects where type='U ' and name='spt_committab')
	begin
	print 'Dropping table spt_committab ...'
	drop table spt_committab
	end
else
	begin
	print 'Nonexistent is table spt_committab.'
	end


if exists (select * from sysobjects where type='U ' and name='spt_datatype_info')
	begin
	print 'Dropping table spt_datatype_info ...'
	drop table spt_datatype_info
	end
else
	begin
	print 'Nonexistent is table spt_datatype_info.'
	end


if exists (select * from sysobjects where type='U ' and name='spt_datatype_info_ext')
	begin
	print 'Dropping table spt_datatype_info_ext ...'
	drop table spt_datatype_info_ext
	end
else
	begin
	print 'Nonexistent is table spt_datatype_info_ext.'
	end


if exists (select * from sysobjects where type='U ' and name='spt_monitor')
	begin
	print 'Dropping table spt_monitor ...'
	drop table spt_monitor
	end
else
	begin
	print 'Nonexistent is table spt_monitor.'
	end


if exists (select * from sysobjects where type='U ' and name='spt_server_info')
	begin
	print 'Dropping table spt_server_info ...'
	drop table spt_server_info
	end
else
	begin
	print 'Nonexistent is table spt_server_info.'
	end

Go

Dump Transaction master with no_log
Go

if exists (select * from sysobjects where type='U ' and name='spt_values')
	begin
	print 'Dropping table spt_values ...'
	drop table spt_values
	end
else
	begin
	print 'Nonexistent is table spt_values.'
	end



Go
set nocount off
Go

Print 'Procedures & User Tables still present:'

Select type,name from sysobjects
   where type in ('P ','TR','U ','V ','X ')
   and   category & 2 <> 0
   order by type,name
Go
set nocount on
Go

use master
Go

Dump Transaction master with no_log
Go
Checkpoint
Go

print 'End of file.'
GO
-- - ----- EndOfFile

