Web app that limits access by the # of objects created

R

Richard

I'm not quite sure the best way of going about this (code in the
business tier or stored procedure on the SQL Server). I have an
e-commerce web app that generates labels for the user. The sales
department wants to offer "packages" where the customer pre-pays for n
amount of labels made. Once they hit their limit, the feature is
disabled.

Since I'm not the best SQL guru, I'm not sure how to store data for
this scenario, or even know if there is some sort of "bell and whistle"
in SQL Server that I don't know about.
Any ideas are always appreciated.

- Richard
- MAIL, Inc
 
K

Kevin Spencer

Hmmm... It seems like you might want to keep track in your database of how
many labels each customer has purchased, as well as the number they have
pre-paid for. Then it's a simple query to find out if they have reached
their limit.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
L

Lucas Tam

I'm not quite sure the best way of going about this (code in the
business tier or stored procedure on the SQL Server). I have an
e-commerce web app that generates labels for the user. The sales
department wants to offer "packages" where the customer pre-pays for n
amount of labels made. Once they hit their limit, the feature is
disabled.

A simple way is to have a table with the UserID, Labels Purchase, Labels
Used

Enable the fuction if Labels purchased is >= Labels Used.

Of course you can design the database tables to be much more complex (i.e.
have a "Packages Table" which you reference) but that maybe a little too
much for you if you're not familiar with SQL.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top