Script sp_configure Output To Migrate Settings Between SQL Servers
Sometimes when setting up a new server, all you want is for it to work and be configured exactly like the old server. In some cases, the new server is almost identical in every way already. If you've worked much with SQL Server, you know very well that there are a billion switches and knobs and every time you do this, you forget at least one. I had a similar situation recently and figured I'd be lazy about it and just turned the output of sp_configure in to a script I could execute on the new server:
scriptSpConfigure.sql - run this on the old/source server
EXEC SP_CONFIGURE 'show advanced options' , 1; GO RECONFIGURE; GO DECLARE @spConfigureOutput TABLE ([name] VARCHAR(255) ,[minimum] INT ,[maximum] INT ,[config_value] INT ,[run_value] INT) INSERT INTO @spConfigureOutput EXEC SP_CONFIGURE SELECT 'EXEC sp_configure ''' + name + ''', ' + CAST(config_value AS VARCHAR) FROM @spConfigureOutput GO EXEC SP_CONFIGURE 'show advanced options' , 0; GO RECONFIGURE; GO
Copy the selected rows and paste in to another SSMS window, add the show advanced options switch above and below - should end up with something like this after you remove all the settings you don't care about or don't want on the new server:
EXEC SP_CONFIGURE 'show advanced options' , 1; GO RECONFIGURE; GO EXEC SP_CONFIGURE 'Ad Hoc Distributed Queries', 1 EXEC SP_CONFIGURE 'Agent XPs', 1 EXEC SP_CONFIGURE 'clr enabled', 1 EXEC SP_CONFIGURE 'cost threshold for parallelism', 5 EXEC SP_CONFIGURE 'cursor threshold', -1 EXEC SP_CONFIGURE 'Database Mail XPs', 1 EXEC SP_CONFIGURE 'default full-text language', 1033 EXEC SP_CONFIGURE 'default trace enabled', 1 EXEC SP_CONFIGURE 'fill factor (%)', 80 EXEC SP_CONFIGURE 'ft crawl bandwidth (max)', 100 EXEC SP_CONFIGURE 'ft notify bandwidth (max)', 100 EXEC SP_CONFIGURE 'max full-text crawl range', 4 EXEC SP_CONFIGURE 'max server memory (MB)', 10000 EXEC SP_CONFIGURE 'max text repl size (B)', 65536 EXEC SP_CONFIGURE 'min memory per query (KB)', 1024 EXEC SP_CONFIGURE 'min server memory (MB)', 10000 EXEC SP_CONFIGURE 'nested triggers', 1 EXEC SP_CONFIGURE 'network packet size (B)', 4096 EXEC SP_CONFIGURE 'PH timeout (s)', 60 EXEC SP_CONFIGURE 'query wait (s)', -1 EXEC SP_CONFIGURE 'remote access', 1 EXEC SP_CONFIGURE 'remote login timeout (s)', 20 EXEC SP_CONFIGURE 'remote query timeout (s)', 900 EXEC SP_CONFIGURE 'scan for startup procs', 1 EXEC SP_CONFIGURE 'server trigger recursion', 1 EXEC SP_CONFIGURE 'SMO and DMO XPs', 1 EXEC SP_CONFIGURE 'show advanced options' , 0; RECONFIGURE; GO;



