SET ARITHABORT ON at the datbase level

Forum for users of SQL Packager database archive utility

SET ARITHABORT ON at the datbase level

Postby christiang » Tue Feb 03, 2009 7:46 pm

I was wondering how I would set ARITHABORT on at the database level. Normal I would use the following script:

ALTER DATABASE [database_name] SET ARITHABORT ON;

Since I don't know the name of the datbase ahead of time when using the packager how can I do this?
christiang
 
Posts: 5
Joined: Tue Feb 03, 2009 7:42 pm

Postby Chris Auckland » Fri Feb 06, 2009 4:53 pm

Thanks for your post.

The schema script in the package will set the database options. It will use the same options set in the database you package. e.g.

SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON
GO

However, if you don't see the options you want you can add them to the script. You can set options OFF in the same manner.

You don't need to set the database name as the script will already be running in the context of the new/updated database.

I hope this is helpful.
Chris
Chris Auckland
 
Posts: 760
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

Postby Chris Auckland » Thu Feb 12, 2009 10:23 am

I'm just updating this post as the customer correctly pointed out that my original response would only set the option for that particular session.

If you want to set the option for the new database during install, then you can set ARITHABORT as one of the new database options. I believe the only way to do this will be to edit the PackageProperties resource file and add the extra option.

To do this, export the package as a C# project. Open the project in Visual Studio and edit PackageProperties.resx. You can then add the extra option in PACKAGE_NEW_DBOPTIONS. e.g.

PACKAGE_NEW_DBOPTIONS torn page detection;auto create statistics;auto update statistics;ARITHABORT;

When you build the project, the new databases will be created with ARITHABORT ON.
Chris
Chris Auckland
 
Posts: 760
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.


Return to SQL Packager Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests