TRUNCATE & RESET DB (KEEPS INVENTORY, CUSTOMERS, VENDORS0

QUERY TO RESET DB WHILE KEEPING INVENTORY, VENDORS, CUSTOMERS

-- Truncate the specified tables
TRUNCATE TABLE [Adjustments];
TRUNCATE TABLE [AlternateSKU];
TRUNCATE TABLE [Appointments];
TRUNCATE TABLE [Audit];
TRUNCATE TABLE [AuthPurchaser];
TRUNCATE TABLE [Bank];
TRUNCATE TABLE [Bank_Checks];
TRUNCATE TABLE [Bank_Checks_Bank];
TRUNCATE TABLE [Bank_Recon];
TRUNCATE TABLE [BatchSettle];
TRUNCATE TABLE [BeverageCode];
TRUNCATE TABLE [BillingInvoices];
TRUNCATE TABLE [BillingPayments];
TRUNCATE TABLE [BillingReminder];
TRUNCATE TABLE [biochecks_CheckMaintanance];
TRUNCATE TABLE [biochecks_CustData];
TRUNCATE TABLE [biochecks_DetailsAmounts];
TRUNCATE TABLE [BioMetric];
TRUNCATE TABLE [BuyDown];
TRUNCATE TABLE [CanceledInvoices];
TRUNCATE TABLE [CanceledItems];
TRUNCATE TABLE [CaseSku];
TRUNCATE TABLE [CashierMonitoring];
TRUNCATE TABLE [Category];
TRUNCATE TABLE [CDTFA_F];
TRUNCATE TABLE [CheckFile];
TRUNCATE TABLE [Checkout];
TRUNCATE TABLE [Checks];
TRUNCATE TABLE [ChecksDetails];
TRUNCATE TABLE [ClockIn];
TRUNCATE TABLE [CloseDaydate];
TRUNCATE TABLE [CreditCard];
TRUNCATE TABLE [CreditConfig];
TRUNCATE TABLE [Customer_Ledger];
TRUNCATE TABLE [DailyDeal];
TRUNCATE TABLE [DailyNumber];
TRUNCATE TABLE [DandHOrder];
TRUNCATE TABLE [Delivery];
TRUNCATE TABLE [Discontinued_items];
TRUNCATE TABLE [DiscountDescription];
TRUNCATE TABLE [DiscountDetail];
TRUNCATE TABLE [DriveThru];
TRUNCATE TABLE [FeaturedItems];
TRUNCATE TABLE [FieldPro_Details];
TRUNCATE TABLE [FieldPro_Main];
TRUNCATE TABLE [FinancialOperation];
TRUNCATE TABLE [GiftCard];
TRUNCATE TABLE [GiftCardTrans];
TRUNCATE TABLE [HandHeld_NewItems];
TRUNCATE TABLE [HandHeld_NewPrices];
TRUNCATE TABLE [Invoices];
TRUNCATE TABLE [InvoiceDetails];
TRUNCATE TABLE [ItemMessages];
TRUNCATE TABLE [KDS];
TRUNCATE TABLE [Kit];
TRUNCATE TABLE [Labels];
TRUNCATE TABLE [Labels_Food_Batch];
TRUNCATE TABLE [Labels_Food_Cat];
TRUNCATE TABLE [Layaway];
TRUNCATE TABLE [LayawayDetails];
TRUNCATE TABLE [LayawayPayments];
TRUNCATE TABLE [LayawaySetup];
TRUNCATE TABLE [LiveCashierData];
TRUNCATE TABLE [Locks];
TRUNCATE TABLE [LotMatrix];
TRUNCATE TABLE [MercuryBatchSum];
TRUNCATE TABLE [Messages];
TRUNCATE TABLE [MixandMatch];
TRUNCATE TABLE [NoSale];
TRUNCATE TABLE [OfflineTables];
TRUNCATE TABLE [OldPasswords];
TRUNCATE TABLE [OnlineOrderDetails];
TRUNCATE TABLE [OnlineOrderMain];
TRUNCATE TABLE [Open_Shift];
TRUNCATE TABLE [OrderList];
TRUNCATE TABLE [PONumbers];
TRUNCATE TABLE [PriceChangeHistory];
TRUNCATE TABLE [PriceGroup];
TRUNCATE TABLE [Printed];
TRUNCATE TABLE [Pull];
TRUNCATE TABLE [PurchaseOrder];
TRUNCATE TABLE [PurchaseOrderDetails];
TRUNCATE TABLE [Receiving];
TRUNCATE TABLE [Receiving_Items];
TRUNCATE TABLE [RemovedItems];
TRUNCATE TABLE [ReportDates];
TRUNCATE TABLE [ReturnCode];
TRUNCATE TABLE [ROA];
TRUNCATE TABLE [SalesReps];
TRUNCATE TABLE [Schedule];
TRUNCATE TABLE [SecurityOverideLog];
TRUNCATE TABLE [Serial];
TRUNCATE TABLE [ServiceDept];
TRUNCATE TABLE [ServiceDept1];
TRUNCATE TABLE [ServiceDeptCheckList];
TRUNCATE TABLE [ServiceDeptDiagCodes];
TRUNCATE TABLE [ServiceDeptDiagnostic];
TRUNCATE TABLE [ShipPay];
TRUNCATE TABLE [ShippingLabel];
TRUNCATE TABLE [SlideShow];
TRUNCATE TABLE [SubMenu2];
TRUNCATE TABLE [TableLayout];
TRUNCATE TABLE [TableLayoutSections];
TRUNCATE TABLE [TerminalMessage];
TRUNCATE TABLE [TicketSystem];
TRUNCATE TABLE [TicketSystemDetail];
TRUNCATE TABLE [TicketSystemStatus];
TRUNCATE TABLE [TimeClock];
TRUNCATE TABLE [Vendor_Backoffice];
TRUNCATE TABLE [Vendors];
TRUNCATE TABLE [WebNewCustomerForm];
TRUNCATE TABLE [Weborder_Details];
TRUNCATE TABLE [Weborder_Main];
TRUNCATE TABLE [WorkOrder];
TRUNCATE TABLE [WorkOrder_Mobile];
TRUNCATE TABLE [WorkOrderDetails];
TRUNCATE TABLE [WorkOrderDetails_Mobile];
TRUNCATE TABLE [YTD_Sales];

-- Set [OnHand] column to 0 in the [Inventory] table
UPDATE [Inventory]
SET [OnHand] = '0';

-- Reset [Keyboard] Values
UPDATE [Keyboard]
SET [Visible] = 'True';
UPDATE [Keyboard]
SET [Text] = NULL;
UPDATE [Keyboard]
SET [Bold] = 'True';
UPDATE [Keyboard]
SET [Italic] = 'False';
UPDATE [Keyboard]
SET [Strikeout] = 'False';
UPDATE [Keyboard]
SET [Underline] = 'False';
UPDATE [Keyboard]
SET [Size] = '8.25';

-- Reset [NCR_KeyMap] Values
UPDATE [NCR_KeyMap]
SET [is_dept] = 'False';
UPDATE [NCR_KeyMap]
SET [is_tender] = 'False';
UPDATE [NCR_KeyMap]
SET [is_amount] = 'False';
UPDATE [NCR_KeyMap]
SET [txtupc] = NULL;
UPDATE [NCR_KeyMap]
SET [tender] = NULL;
UPDATE [NCR_KeyMap]
SET [amount] = '0';

Last updated