This routine sets standardised database options. It is a common problem that database options differ from the site standard, especially in Development environments. Running this routine via a weekly SQL Agent job overcomes this problem.
To set standard options for all databases:
EXEC spSetDBOptions
To set standard options for a given database:
EXEC spSetDBOptions @dbname='Your_Database'
To generate code but make no changes, use the @process parameter. To seet debugging information, use the @debug parameter:
EXEC spSetDBOptions @process='N',@debug='Y'
The setting of individual options can be suppressed by using the @setopts, @setowner, @setsize parameters.
This routine will produce an appropriate message if an errors occurs. Use the following statement to add the message to SQL Server:
EXEC sp_addmessage 700000, 16, N'%ls'