Postman collection
Customers Read

pixiRepairCustomerData

Returns the billing and shipping addresses and shop notes of orders created in a date range, as a preview for repairing strange characters.

According to its header comment, the procedure is meant to repair strange characters for API output in customer data. The current code does not change any data. It only selects the affected records.

Steps:

  1. If FromDate is not passed, it is set to the start of the current day (00:00:00). If ToDate is not passed, it is set to the end of the current day (23:59:59.997).
  2. It collects all orders from OrderHeader whose CreateDate lies between FromDate and ToDate (both inclusive) and that have both a billing address (AddrRef <> 0) and a shipping address (ShipAdrRef <> 0).
  3. It collects the billing and shipping address keys of these orders.
  4. It opens a transaction:
    • With CommitResult = 1 the empty transaction is committed. No result set is returned.
    • Otherwise (0 or NULL) two result sets are returned and the transaction is rolled back:
      • the name, address and phone fields of all collected addresses from Addresses. Each address appears only once.
      • OrderNr and Shop_Note of all collected orders.

The sort order of both result sets is not defined.

Notes

  • Despite its name, the procedure performs no updates. The transaction contains no data changes, so CommitResult = 1 has no effect except suppressing the output. The actual repair logic appears to have been removed.
  • All reads use NOLOCK. Uncommitted data may therefore be returned.
  • Orders without a billing or shipping address (reference 0) are ignored entirely.
  • Large date ranges can produce large result sets.

Tables used

OrderHeader · Read Addresses · Read
SQL object:
dbo.pipiRepairCustomerData
Updated at 2026-10-30