473,499 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pb with a trigger

hello,

I've a problem with a trigger :
this trigger update a file with an index field but it's return an error
: UPDATE stop because the Set option : "QUOTED_IDENTIFIER" return bad
parameters

for information, this is my trigger :

CREATE TRIGGER COOP_article ON F_ARTICLE FOR insert AS
SET NOCOUNT ON
set arithabort on
set concat_null_yields_null on
set quoted_identifier on
set ansi_nulls on
set ansi_padding on
set ansi_warnings on
set numeric_roundabort off
declare @code varchar(17)
select @code=ar_ref from inserted
begin
*/ replace if reference = 0 */
if @code='0'
begin

update f_article set ar_ref='test' from f_article join
inserted on f_article.cbmarq=inserted.cbmarq
end
end
if you ave an idea...
thanks
philned
Jul 20 '05 #1
1 1436
[posted and mailed, please reply in news]

philned (ph*****@wanadoo.fr) writes:
I've a problem with a trigger :
this trigger update a file with an index field but it's return an error
: UPDATE stop because the Set option : "QUOTED_IDENTIFIER" return bad
parameters


This is because there is an indexed view or an indexed computed
column some where.

Putting all those SET commands in the trigger is not a good idea, because
it may cause recompilations which can be expensive performancewise.

Instead make sure that you issue a SET ARITHABORT ON when you connect.
You can also set this default for your database, or even your setver.

As for QUOTED_IDENTIFIER, this setting is a bit special. It doesn't
help if you set it in the trigger, because it is the setting of
QUOTED_IDENTIFER when the trigger was created that applies. This also
applies to the setting ANSI_NULLS.

There are some tools that unfortunately turn of QUOTED_IDENTIFIER by
default. The command-line tool OSQL is one of them. Use -I with OSQL
to have QUOTED_IDENTIFIER on. The other is Enterprise Manger, but you
should not use EM for editing SQL Code, use Query Analyzer instead.

In short: you need to reload the trigger with QUOTED_IDENTIIER on.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1991
by: Matik | last post by:
Hello to all, I have a small question. I call the SP outer the DB. The procedure deletes some record in table T1. The table T1 has a trigger after delete. This is very importand for me, that...
6
6530
by: Scott CM | last post by:
I have a multi-part question regarding trigger performance. First of all, is there performance gain from issuing the following within a trigger: SELECT PrimaryKeyColumn FROM INSERTED opposed...
9
3448
by: Martin | last post by:
Hello, I'm new with triggers and I can not find any good example on how to do the following: I have two tables WO and PM with the following fields: WO.WONUM, VARCHAR(10) WO.PMNUM,...
6
7117
by: Mary | last post by:
We are developing a DB2 V7 z/OS application which uses a "trigger" table containing numerous triggers - each of which is activated by an UPDATE to a different column of this "trigger" table. When...
0
7125
by: Dave Sisk | last post by:
I've created a system or external trigger on an AS/400 file a.k.a DB2 table. (Note this is an external trigger defined with the ADDPFTRG CL command, not a SQL trigger defined with the CREATE...
0
2445
by: JohnO | last post by:
Thanks to Serge and MarkB for recent tips and suggestions. Ive rolled together a few stored procedures to assist with creating audit triggers automagically. Hope someone finds this as useful as...
1
2191
by: deepdata | last post by:
Hi, I am creating a trigger in DB2 express version. When i use the following syntax to create trigger CREATE TRIGGER USER_PK_TRIGGER BEFORE INSERT On users REFERENCING NEW As N FOR EACH...
9
9295
by: Ots | last post by:
I'm using SQL 2000, which is integrated with a VB.NET 2003 app. I have an Audit trigger that logs changes to tables. I want to apply this trigger to many different tables. It's the same trigger,...
7
3272
by: Shane | last post by:
I have been instructed to write a trigger that effectively acts as a foreign key. The point (I think) is to get me used to writing triggers that dont use the primary key(s) I have created the...
11
7841
by: tracy | last post by:
Hi, I really need help. I run this script and error message appeal as below: drop trigger log_errors_trig; drop trigger log_errors_trig ERROR at line 1: ORA04080: trigger 'LOG_ERRORS-TRIG'...
0
7009
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5475
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3094
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
302
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.