Skip to main content
Inspiring
June 25, 2008
Question

Change Default Connection Properties for SQL Server / ColdFusion 7

  • June 25, 2008
  • 1 reply
  • 2986 views
Change Default Connection Properties for SQL Server / ColdFusion 7


I've started working with indexed views in my Microsoft SQL Server 2005 database. Whenever a SQL statement alters a field ( INSERT, UPDATE, DELETE ) used by the index on an indexed view certain connection settings must be set.

SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
SET CONCAT_NULL_YIELDS_NULL ON
SET NUMERIC_ROUNDABORT OFF
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON

When ColdFusion connects to SQL server the ARIHABORT setting is OFF causing SQL statements to fail.


I currently have two workarounds for this:

1. Use a stored procedure created with the required settings.

2. Run a cfquery containing the required settings before the UPDATE, INSERT, or DELETE cfquery statement.


Questions:

1. Is it possible to configure ColdFusion's connection to set ARITHABORT ON by default?

2. Does Microsoft's JDBC driver use this setting by default?


My environment:
Microsoft SQL Server 2005
ColdFusion 7.0.2
Windows 2003
Using the SQL Server drivers bundled with CF7


References:
Improving Performance with SQL Server 2005 Indexed Views
http://www.microsoft.com/technet/prodtechnol/sql/2005/impprfiv.mspx

PRB: Error "INSERT Failed" When You Update Table Referenced in an Indexed View
http://support.microsoft.com/kb/305333


Any help is appreciated.
This topic has been closed for replies.

1 reply

Inspiring
September 23, 2010

This is a very old thread, but did you find an answer?

Inspiring
January 29, 2014

Same. We've got the same situation. Brad, did you look at it further and find a solution?

--

Adam

Inspiring
January 29, 2014

I gave up on indexed views for unrelated reasons.  There were just too many restrictions in SQL Server on what I could do with them.  I ended up just creating an indexed "denormalized" table that i would manually populate when the data changed, and i repointed my view to it.  Since my data didn't change often, it was a tradeoff that I was willing to live with