English Boards > Tutorials

[TESTED] Clear All orders - periods - Payments - Tickets .. etc etc Script via.

(1/1)

icemax:
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: ---SQLCMD -S servername -d SambaData2 -i Query.sql

--- End code ---

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: ---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]
--- End code ---

exec :

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

WARNING process erases all data


bye
Massimo

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

JohnS:
Yes. It deletes all transactional data.

Navigation

[0] Message Index

Go to full version