Author Topic: [TESTED] Clear All orders - periods - Payments - Tickets .. etc etc Script via.  (Read 33427 times)

icemax

  • Newbie
  • *
  • Posts: 18
hello to all :)

WARNING process erases all data

how to Clear All data .. T E S T E D  via COMMAND LINE or BATCH FILES:



  • [AccountTransactions]
    [CashTransactions]
    [CostItems]
    [Discounts]
    [PaidItems]
    [Payments]
    [PeriodicConsumptionItems]
    [PeriodicConsumptions]
    [TicketItemProperties]
    [TicketItems]
    [Tickets]
    [TransactionItems]
    [Transactions]
    [WorkPeriods]

required  MS SQL SERVER 2005 or higher

1° Batch file : DELETE.bat

Code: [Select]
SQLCMD -S servername -d SambaData2 -i Query.sql

servername = name of pcserver : example my server is icemax-VAIO\SQLEXPRESS
SambaData2 = database of SambaPOS
Query.sql = query file for delete

2° Query file Query.sql

Code: [Select]
DELETE FROM [AccountTransactions]
GO
DELETE FROM [CashTransactions]
GO
DELETE FROM [CostItems]
GO
DELETE FROM [Discounts]
GO
DELETE FROM [PaidItems]
GO
DELETE FROM [Payments]
GO
DELETE FROM [PeriodicConsumptionItems]
GO
DELETE FROM [PeriodicConsumptions]
GO
DELETE FROM [TicketItemProperties]
GO
DELETE FROM [TicketItems]
GO
DELETE FROM [Tickets]
GO
DELETE FROM [TransactionItems]
GO
DELETE FROM [Transactions]
GO
DELETE FROM [WorkPeriods]

exec :

copy the two files (DELETE.bat + Query.sql in a folder and run : DELETE.bat

WARNING process erases all data


bye
Massimo
« Last Edit: March 16, 2013, 07:46:42 am by icemax »
SambaPOS : the One

abrar226

  • Newbie
  • *
  • Posts: 1
hi,
will it delete the customer payments.
we have a lot of customers who still need to pay their debts.
thanks
abrar

JohnS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Yes. It deletes all transactional data.
SambaPOS - POS'n the World, one Terminal at a time.