Re: Deleting Invoices
Dale E. Reed Jr. ( (no email) )
Sat, 01 Mar 1997 18:00:50 -0800
Jeffrey Betts wrote:
> I am trying to delete all existing invoices
> and payments from the emerald database.
> I picked up these commands from the list
> a while back. They were from Dale.
> TRUNCATE TABLE Invoiceitems
> TRUNCATE TABLE Payments
> TRUNCATE TABLE Invoices
> When I run these commands in ISQL/w I get the error
> Msg 4712 Level 16, State 1
> Cannot truncate table 'payments' because it is being referanced by a
> foreign key constraint.
Update InvoiceItems Set PaymentID = NULL
TRUNCATE TABLE Payments
TRUNCATE TABLE Invoiceitems
TRUNCATE TABLE Invoices
That should work.
-- Dale E. Reed Jr. (email@example.com)_________________________________________________________________ IEA Software, Inc. | RadiusNT, Emerald, and NT FAQs Internet Solutions for Today | http://www.emerald.iea.com