
/*
** CheckObj.SQL		1996/02/29 16:41
**
** (From old Upgrade.sql)
**
** (Unneeded.  Superceeded by /b and sp_MS_upd_sysobj_category.)
**
** 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
go
dump tran master with no_log
go
checkpoint
go
set nocount on
go

-- - - - -


if exists (select * from sysobjects where name = 'sp_objcheck'
			and sysstat & 0xf = 4)
	begin
	raiserror('Dropping sp_objcheck...',0,1)
	drop procedure sp_objcheck
	end
go

if exists (select * from sysobjects where name = 'sp_check_objects'
			and sysstat & 0xf = 4)
	begin
	raiserror('Dropping sp_check_objects...',0,1)
	drop procedure sp_check_objects
	end
go

if exists (select * from sysobjects
		where name = 'MSobjects'
			and sysstat & 0xf = 3)
	begin
	raiserror('Dropping table MSobjects...',0,1)
	drop table MSobjects
	end
go

print ''
print 'Creating table of Microsoft created objects.'
go

/***********************  Soon will eliminate this entirely, if not used...
CREATE TABLE MSobjects
(
objectname varchar(30) not null,	-- name of object
object_cat varchar(15) not null,	-- category of object

object_stat int		   null		-- Bitmap of where we can expect to find this object:
					-- 1=master_only ,2=msdb_only ,4=all
)
***********************/
go

print ''
print 'Inserting names of base system tables.'
go

print ''
print 'Creating procedure ''sp_objcheck''.'
go
create procedure sp_objcheck
	@objcat varchar(15),
	@omit_cat varchar(15)
as
-- This sproc is no longer needed, just enduring it is no longer called.
raiserror('sp_objcheck _sdf3811w @objcat=''%s'' @omit_cat=''%s'''
	,0,1,@objcat,@omit_cat)
go

print ''
print 'Creating procedure ''sp_check_objects''.'
go
create procedure sp_check_objects
	@obj_cat varchar(15) = '%',
	@omit_cat varchar(15) = 'none'
as
-- This sproc is no longer needed, just enduring it is no longer called.
raiserror('sp_check_objects _sdf2904m @obj_cat=''%s'' @omit_cat=''%s'''
	,0,1,@obj_cat,@omit_cat)
go

print ''
print 'Now executing ''sp_check_objects''...'
go

use master
go

--  exec sp_check_objects 'upgrade'

--------  Special case sysobjects.category | 2

update          sysobjects
      set       category = category | 2
      where     category & 2 = 0
      and       name in (
	 'MSobjects'
	,'sp_check_objects'
	,'sp_objcheck'
                        )

go

use master
go

print ''
print 'CheckObj.SQL completed.'
go

dump tran master with no_log
go
checkpoint
go
-- -

