March 16, 2015

Report on all active promotion codes in ASPDotNetStorefront

Filed under: Tips — Tags: — Webopius @ 8:44 pm

Recent releases of ASPDotNetStorefront have an updated promotion engine with a lot more flexibility for managing your eCommerce promotions.

However, once you have a lot of promotion codes in your store, you may find it difficult keeping track of the active/unexpired promotions in your database. If this is the case, this SQL Statement will give you all active promotion codes in descending expiry date order:

select Code, Description, AutoAssigned,
CAST(CAST(CAST(PromotionRuleData AS XML).query('data(//PromotionRuleBase/ExpirationDate)') as varchar(100)) as datetime) as expires
from dbo.Promotions
where Active = 1
order by expires desc

  • Tags