Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Set standard database options

By Ed Vassie, 2011/09/19

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'

Total article views: 2030 | Views in the last 30 days: 6
 
Related Articles
FORUM

Database Options

Database Options

FORUM

How to handle optional parameter in SSRS with oracle

passing null value to an oracle database from SSRS, incase a parameter is set optional

FORUM

stored procedure with optional parameters

creating stored procedure with optional parameters

FORUM

How to debug T-SQL

Debug, How to, T-SQL, Newbie

FORUM

Database Option

Checking for database option in Mgt Studio

Tags
databases    
setup    
sql server 2005    
sql server 7    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones