Options

SET ARITHABORT ON at the datbase level

christiangchristiang Posts: 9
edited February 12, 2009 4:23AM in SQL Packager Previous Versions
I was wondering how I would set ARITHABORT on at the database level. Normal I would use the following script:

ALTER DATABASE i]database_name[/i 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?

Comments

  • Options
    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
  • Options
    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
Sign In or Register to comment.