Re: delete charges

Tommy Cheng ( tommycheng@pcmagic.net )
Tue, 11 Aug 1998 13:28:43 -0700

Thanks. Already tried that before I sent this. This is what I get:

Msg 547, Level 16, State 2
DELETE statement conflicted with COLUMN REFERENCE constraint
'FK__CallHisto__Charg__471C9436'. The conflict occurred in database
'Emerald', table 'CallHistory', column 'ChargeID'
Command has been aborted.

How do I get around this?

I was thinking:

Update Charges
Set ItemID = NULL
WHERE ChargeID = 1234

DELETE FROM CallHistory
WHERE ChargeID = 1234

DELETE FROM Charges
WHERE ChargeID = 1234

But I can't get it to work.

Maybe I should get rid of the constraint then do the delete?

Tommy Cheng
PC Magic Network

Josh Hillman wrote:
>
> > From: Tommy Cheng <tommycheng@pcmagic.net>
> > How do I delete charges which was created by consolidation process?
> > After I did consolidation, there are few charges created for some of my
> > users which I need to delete. Thanks.
>
> Using ISQL, run the following, but make sure that these charges are NOT
> already part of an existing invoice.
>
> DELETE FROM Charges
> WHERE ChargeID = 1234 /* the number you see next to the Charge in
> a user's MBR under the History tab */