You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by Ray Wiggins <ra...@swingvote.com> on 2008/02/07 16:24:56 UTC
How do you set SQL Server 2005 database options with iBATIS?
How do you set SQL Server 2005 database options prior to executing a
query with iBATIS?
e.g.
SET NOCOUNT ON;
SET ANSI_NULL_DFLT_ON ON;
SET CONCAT_NULL_YIELDS_NULL ON;
SET ANSI_NULLS ON;
RE: How do you set SQL Server 2005 database options with iBATIS?
Posted by Ray Wiggins <ra...@swingvote.com>.
Thanks! I had a typo in one of the SET statements which caused my query
to fail.
BTW, I am using includes for the SET statements:
<statements>
<!-- This SQL fragment sets database options -->
<sql id="DatabaseOptions">
SET NOCOUNT ON;
SET ANSI_NULL_DFLT_ON ON;
SET CONCAT_NULL_YIELDS_NULL ON;
SET ANSI_NULLS ON;
SET ANSI_PADDING ON;
SET ANSI_WARNINGS ON;
SET ARITHABORT ON;
SET CONCAT_NULL_YIELDS_NULL ON;
SET QUOTED_IDENTIFIER ON;
SET NUMERIC_ROUNDABORT OFF;
</sql>
</statements>
<select id= . . .>
<include refid="DatabaseOptions"/>
SELECT . . .
________________________________
From: Tony Johnson [mailto:listAccount@deepcode.co.uk]
Sent: Thursday, February 07, 2008 11:13 AM
To: user-cs@ibatis.apache.org
Subject: RE: How do you set SQL Server 2005 database options with
iBATIS?
Can you not just add that as part of your SQL statement? Eg:
<select.....>
SET NOCOUNT ON;
SET ANSI_NULL_DFLT_ON ON;
SET CONCAT_NULL_YIELDS_NULL ON;
SET ANSI_NULLS ON;
SELECT field1, field2 FROM myTable ORDER BY field1
</select>
You could also look at the extends attribute or the include element to
bring the same SET's into each query....
Cheers
Tony
From: Ray Wiggins [mailto:ray.wiggins@swingvote.com]
Sent: 07 February 2008 15:25
To: user-cs@ibatis.apache.org
Subject: How do you set SQL Server 2005 database options with iBATIS?
How do you set SQL Server 2005 database options prior to executing a
query with iBATIS?
e.g.
SET NOCOUNT ON;
SET ANSI_NULL_DFLT_ON ON;
SET CONCAT_NULL_YIELDS_NULL ON;
SET ANSI_NULLS ON;
RE: How do you set SQL Server 2005 database options with iBATIS?
Posted by Tony Johnson <li...@deepcode.co.uk>.
Can you not just add that as part of your SQL statement? Eg:
<select...>
SET NOCOUNT ON;
SET ANSI_NULL_DFLT_ON ON;
SET CONCAT_NULL_YIELDS_NULL ON;
SET ANSI_NULLS ON;
SELECT field1, field2 FROM myTable ORDER BY field1
</select>
You could also look at the extends attribute or the include element to bring
the same SET's into each query..
Cheers
Tony
From: Ray Wiggins [mailto:ray.wiggins@swingvote.com]
Sent: 07 February 2008 15:25
To: user-cs@ibatis.apache.org
Subject: How do you set SQL Server 2005 database options with iBATIS?
How do you set SQL Server 2005 database options prior to executing a query
with iBATIS?
e.g.
SET NOCOUNT ON;
SET ANSI_NULL_DFLT_ON ON;
SET CONCAT_NULL_YIELDS_NULL ON;
SET ANSI_NULLS ON;