** 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
set nocount on
go
declare @vdt varchar(99)
select @vdt = convert(varchar,getdate(),113)
raiserror('Starting Install\SptValue.SQL at %s',0,1,@vdt) with nowait
raiserror('This file creates all the ''SPT_'' tables.',0,1)
go
/**************** No system sprocs, thus 'allow updates' unneeded for this file.
print ''
print 'Making sure that updates to system tables are allowed.'
-go
declare @dbcc_current_version integer
,@int1 integer
dbcc getvalue('current_version')
select @dbcc_current_version = @@error
if ( exists (select * from sysobjects where name='sp_configure')
AND @dbcc_current_version = (select version from sysdatabases where name='master')
AND 1 <> (select value from syscurconfigs where config = 102)
)
begin --Query tree compatible
exec @int1 = sp_configure 'allow updates',1
if @@error <> 0 or @int1 <> 0
raiserror('Bad sp_configure exec at top of SptValue.SQL, killing spid.'
,22,127) with log
reconfigure with override
end
-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 SptValue.SQL unless updates to system tables are enabled. Shutdown server and restart with the ''-m'' option or use sp_configure to enable updates to system tables.'