je cherche a réaliser un déclencheur en cas d'update sur une zone
indexée (Reference article d'un fichier article...)
j'obtiens systematiquement le message suivant :
UPDATE a échoué car les options SET suivantes comportent des parametres
incorrects : "QUOTED_IDENTIFIER"
pour info, voici mon 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
*/ mise a test de la reference si le code saisie est 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
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Philippe [MS]
On ne peut pas faire plus simple ?
Du genre :
CREATE TRIGGER COOP_article ON F_ARTICLE FOR insert AS BEGIN SET NOCOUNT ON
*/ mise a test de la reference si le code saisie est 0 */ IF EXISTS(SELECT 1 FROM inserted WHERE ar_ref = '0') BEGIN UPDATE f_article SET ar_ref='test' FROM f_article JOIN inserted ON f_article.cbmarq = inserted.cbmarq END END
Phil.
"philned" wrote in message news:41875ea5$0$7021$
bonjour,
je cherche a réaliser un déclencheur en cas d'update sur une zone indexée (Reference article d'un fichier article...) j'obtiens systematiquement le message suivant : UPDATE a échoué car les options SET suivantes comportent des parametres incorrects : "QUOTED_IDENTIFIER"
pour info, voici mon 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 */ mise a test de la reference si le code saisie est 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
si vous avez une idée.... merci philned
On ne peut pas faire plus simple ?
Du genre :
CREATE TRIGGER COOP_article ON F_ARTICLE
FOR insert
AS
BEGIN
SET NOCOUNT ON
*/ mise a test de la reference si le code saisie est 0 */
IF EXISTS(SELECT 1 FROM inserted WHERE ar_ref = '0')
BEGIN
UPDATE f_article SET ar_ref='test' FROM f_article
JOIN inserted ON f_article.cbmarq = inserted.cbmarq
END
END
Phil.
"philned" <philned@wanadoo.fr> wrote in message
news:41875ea5$0$7021$636a15ce@news.free.fr...
bonjour,
je cherche a réaliser un déclencheur en cas d'update sur une zone
indexée (Reference article d'un fichier article...)
j'obtiens systematiquement le message suivant :
UPDATE a échoué car les options SET suivantes comportent des parametres
incorrects : "QUOTED_IDENTIFIER"
pour info, voici mon 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
*/ mise a test de la reference si le code saisie est 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
CREATE TRIGGER COOP_article ON F_ARTICLE FOR insert AS BEGIN SET NOCOUNT ON
*/ mise a test de la reference si le code saisie est 0 */ IF EXISTS(SELECT 1 FROM inserted WHERE ar_ref = '0') BEGIN UPDATE f_article SET ar_ref='test' FROM f_article JOIN inserted ON f_article.cbmarq = inserted.cbmarq END END
Phil.
"philned" wrote in message news:41875ea5$0$7021$
bonjour,
je cherche a réaliser un déclencheur en cas d'update sur une zone indexée (Reference article d'un fichier article...) j'obtiens systematiquement le message suivant : UPDATE a échoué car les options SET suivantes comportent des parametres incorrects : "QUOTED_IDENTIFIER"
pour info, voici mon 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 */ mise a test de la reference si le code saisie est 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