Query for deleting Account from SIMS (for all tables) (Requires Edit)

DELETE
FROM AccountAddress Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountBilling Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountChanges Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountComment Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountContactEmail Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountContactEventType Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountContacts Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountEmail Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountEquipment Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountInvoice Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountMainB Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountPhone Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountSchedule Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountSpecialCode Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountSummaryComment Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountSummaryDispatch Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountSummaryEvent Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountTempSchedule Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountVideo Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountZone Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditAccountAddress Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditAccountBilling Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditAccountComment Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditAccountContact Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditAccountContactEventType Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditAccountEmail Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditAccountEquipment Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditAccountInvoice Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditAccountMain Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditAccountMainB Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditAccountPhone Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditAccountSchedule Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditAccountSpecialCode Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditAccountTempSchedule Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditAccountVideo Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditAccountZone Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditDelayFIFO Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AuditPendingService Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM DelayFIFO Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM EventSchedule Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM EventSummary Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM GuardResponse Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM OutOfService Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM Pager Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM PendingService Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM Traffic Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM Traffic_Completed Where AccountID in (SELECT ID from AccountMain where AccountNumber LIKE '01-011-%')

DELETE
FROM AccountMain Where AccountNumber LIKE '01-011-%'


Was this article helpful?
Thank you for your feedback!
User Icon

Thank you! Your comment has been submitted for approval.