/*
** Copyright Microsoft, Inc. 1994 - 2000
** All Rights Reserved.
*/
set nocount on
go

print ''
print 'RESET'
print '--- SYSCONFIGURES ---'
print ''

print 'sp_configure ''show advanced options'', 1'
print 'go'
print ''

print 'reconfigure with override'
print 'go'
print ''

create table #config
	(optname varchar(35),
	config_value int)
go

insert #config select optname = name, config_value = c.value
                from master.dbo.spt_values, sysconfigures c
                where type = 'C' and number = c.config
		order by name
go

declare curConfig cursor for select optname, config_value from #config
	where optname in (
	'affinity mask',
	'allow updates',
	'cursor threshold',
	'default language',
	'language in cache',
	'max text repl size',
	'max worker threads',
	'media retention',
	'nested triggers',
	'priority boost',
	'remote access',
	'remote login timeout',
	'remote query timeout',
	'set working set size')
for read only
open curConfig

declare @optname varchar (35),
	@config_value int,
	@line varchar (255)

while 1 = 1
	begin
	fetch curConfig into @optname, @config_value
	if @@fetch_status <> 0 break

	select @line = 'sp_configure ''' + @optname + ''', ' + convert(varchar(30), @config_value)
	print @line

	print 'go'
	print ''
	end

deallocate curConfig
go

print 'sp_configure ''show advanced options'', 0'
print 'go'
print ''

print 'reconfigure with override'
print 'go'
print ''
go

