Our support engineers have assembled the top recommended solutions for you.
Microsoft Dynamics AX 2012
Upgrading to Microsoft Dynamics AX 2012
Microsoft Dynamics AX 2009
Application Object Server (AOS)
Enterprise Portal and Role Centers
Inventory Costing in Microsoft Dynamics AX 2009
Invoice Settlements/Discounts/Reversals
SSRS and SSAS Integration
Workflow
Description:
The cleanup procedures in POS are not fully implemented and therefore a small manual job can ensure that your database is not filling up with unnecessary records.
Resolution:
We create a job in SQL to run in a schedule. In this example we use 150 days. All Transactions that exceeds that date will be deleted.
The number of days depends on the frequency of the replication (P-JOB) and normally the value would be much lower like 1-5 days.
1. Go to your SQL Management studio
2. Go to Maintenance Plans
3. Create new plan and call it example DeletePOSData
4. Move over the Execute T-SQL Statement Task
5. Edit the TASK and add the delete statements
USE AXRETAILPOSGO-- All POS transactions tables-- All records that are more than 150 days will be deleted
DELETE FROM dbo.RBOTRANSACTIONBANKEDTENDE20338WHERE transdate < DATEADD(day, -150, CAST(GETDATE() AS date));
DELETE FROM dbo.RBOTRANSACTIONINCOMEEXPEN20158WHERE TRANSDATE < DATEADD(day, -150, CAST(GETDATE() AS date));
DELETE FROM dbo.RBOTRANSACTIONINFOCODETRANSWHERE TRANSDATE < DATEADD(day, -150, CAST(GETDATE() AS date));
DELETE FROM dbo.RBOTRANSACTIONINVENTTRANSWHERE TRANSDATE < DATEADD(day, -150, CAST(GETDATE() AS date));
DELETE FROM dbo.RBOTRANSACTIONLOYALTYPOIN20296WHERE createdDate < DATEADD(day, -150, CAST(GETDATE() AS date));
DELETE FROM dbo.RBOTRANSACTIONLOYALTYPOINTTRANSWHERE createdDate < DATEADD(day, -150, CAST(GETDATE() AS date));
DELETE FROM dbo.RBOTRANSACTIONLOYALTYTRANSWHERE REPLICATED = 1;
DELETE FROM dbo.RBOTRANSACTIONMIXANDMATCHTRANSWHERE TRANSDATE < DATEADD(day, -150, CAST(GETDATE() AS date));
DELETE FROM dbo.RBOTRANSACTIONORDERINVOICETRANSWHERE REPLICATED = 1;
DELETE FROM dbo.RBOTRANSACTIONPAYMENTTRANSWHERE TRANSDATE < DATEADD(day, -150, CAST(GETDATE() AS date));
DELETE FROM dbo.RBOTRANSACTIONSAFETENDERTRANSWHERE TRANSDATE < DATEADD(day, -150, CAST(GETDATE() AS date));
DELETE FROM dbo.RBOTRANSACTIONSALESTRANSWHERE TRANSDATE < DATEADD(day, -150, CAST(GETDATE() AS date));
DELETE FROM dbo.RBOTRANSACTIONTABLEWHERE TRANSDATE < DATEADD(day, -150, CAST(GETDATE() AS date));
DELETE FROM dbo.RBOTRANSACTIONTENDERDECLA20165WHERE TRANSDATE < DATEADD(day, -150, CAST(GETDATE() AS date));
DELETE FROM dbo.RBOTRANSACTIONVARIANTTRANSWHERE TRANSDATE < DATEADD(day, -150, CAST(GETDATE() AS date));
-- POS log table-- ALL data that is more than 150 days will be deleted
DELETE FROM dbo.POSISLOGWHERE LOGDATE < DATEADD(day, -150, CAST(GETDATE() AS date));
6. Edit the Job schedule and let it run every day
7. Save the Maintenance job
8. Make sure that your SQL Agent runs, so the job executes every day
Author: Kim Truelsen
Blog date: 12-2-2012