🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #3916

Re: Delete Problem with ADOExpress

#3916
From: Junlin Xie
Date: Mon, 13 May 2002 11:28
78 lines
2715 bytes
Hi,
    Thanks for your help, I tried to modified my trigger as your said, but
It does not work, the error still occur. but I can execute this command
(delete Employees where EmployeeID = 1 )in commandline, It's no problem,
why?

Thanks again.

Junlin Xie

"Ivan Mihailov" <iradev@mail.vega.bg> wrote in message
news:3cdecfe4_2@dnews...
> Hi,
>
> try this:
>
> CREATE TRIGGER tg_Employees_Del ON dbo.Employees
> FOR DELETE
> AS
>
> SET NOCOUNT OFF
>
> DECLARE @EmployeeID T_ID
>
> SELECT @EmployeeID = EmployeeID FROM Deleted
>
> DELETE [dbo].[ResourceACL] WHERE EmployeeID = @EmployeeID
>
> SET NOCOUNT ON
>
> RETURN
>
>
>
> "Junlin Xie" <jlxie@yahoo.com> wrote in message news:3cd9565a_1@dnews...
> > Hi,
> >     I Have a table named 'Employees' with a triggle for deletion, I want
> to
> > delete a row from client, I trace the command using SQL Profiler, the
> > following the tracing message:
> >     sp_executesql N'DELETE FROM "CELDB".."Employees" WHERE
> > "EmployeeID"=@P1', N'@P1 int', 23
> >     EmployeeID is primary key
> >     and trigger for deletion is:
> >
> > CREATE TRIGGER tg_Employees_Del ON dbo.Employees
> > FOR DELETE
> > AS
> >
> > DECLARE @EmployeeID T_ID
> >
> > SELECT @EmployeeID = EmployeeID FROM Deleted
> >
> > DELETE [dbo].[ResourceACL] WHERE EmployeeID = @EmployeeID
> >
> > RETURN
> >
> > the error message:
> >
> > **************************
> > Error Number: -2147467259
> > Error Source: Microsoft Cursor Engine
> > Error Description: Key information is incorrect, effect multirows.
> > Error Help File:
> > Error Help Context:
> > Error SQL State:
> > Error NativeError: 1009
> >
> > but I can execute this command in commandline, It's no problem, why?
> > Please help me!!!!!
> >
> > Thank you very much!
> >
> > Junlin Xie
> >
> >
>
>
Technical Details
Message-ID: <3cdfa3c2_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews
References: <3cd9565a_1@dnews> <3cdecfe4_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,2516ec76955a76a
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-05-13 04:35:57 PST
From: "Junlin Xie" <jlxie@yahoo.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3cd9565a_1@dnews> <3cdecfe4_2@dnews>
Subject: Re: Delete Problem with ADOExpress
Date: Mon, 13 May 2002 19:28:31 +0800
Lines: 80
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 202.105.138.4
Message-ID: <3cdfa3c2_2@dnews>
X-Trace: dnews 1021289410 202.105.138.4 (13 May 2002 04:30:10 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews