Red Gate forums :: View topic - SET ARITHABORT ON at the datbase level
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Packager 6
SQL Packager 6 forum

SET ARITHABORT ON at the datbase level

Search in SQL Packager 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
christiang



Joined: 03 Feb 2009
Posts: 3

PostPosted: Tue Feb 03, 2009 7:46 pm    Post subject: SET ARITHABORT ON at the datbase level Reply with quote

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?
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 755
Location: Red Gate Software Ltd.

PostPosted: Fri Feb 06, 2009 4:53 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
Chris Auckland



Joined: 24 Oct 2006
Posts: 755
Location: Red Gate Software Ltd.

PostPosted: Thu Feb 12, 2009 10:23 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group