Solved

TSQL auto renewal subscription handling

Posted on 2014-12-30
1
100 Views
Last Modified: 2015-01-30
hello ,
i have a problem how i can handle the subscription first i have 3 kinds of updateType , if the updateType = 1 mean its New Subscription , if updatetype equal to 2 mean Unsubcription and updatetype = 3 for modification and on the latest one i has a 1 fields with rentSucess : false mean the operator not able to charge the user and if its true mean the operator able to charge the user .

the problem that the operator will not send me everytime when he try to charge the users i should automaticly renew the susbcription ( subscription type its daily )

he only send me updatetype = 3 when he fails on charging and once he sucess he will send me updatetpye =3 with rentsucess = true in this case i will automatily extend his subcription for 1 days more  , whene the update type = 3 with rentsucess = false the auto-renewal will be on HOLD once i get new modification with sucess rent the auto renewal work again ..

if i run a agent job how i can handle the modifcation and also the auto daily renewal .
0
Comment
Question by:afifosh
1 Comment
 
LVL 28

Accepted Solution

by:
Ryan McCauley earned 500 total points
ID: 40536827
I'm not sure exactly what you're asking here - are you receiving some kind of CSV file that you're trying to import and merge into an existing table that contains customers with their current status, or are you receiving messages via a TSQL endpoint, or something else entirely? If you can elaborate on the whole process and each of the pieces (ideally with a diagram of some kind), we may be able to better assist you.

If you're just merging in new data to an existing table, then you can use an UPDATE statement to join the two tables and set the status of the customer based on the results of the most recent attempt to charge them (along with automatically extending their expiration date by a day, if necessary). If the person isn't updated from the file, you can issue a second update that extends them by a day as long as they're in good standing.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now