Solved

TSQL auto renewal subscription handling

Posted on 2014-12-30
1
97 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
Comment Utility
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Date Range Syntax Access 2003 10 44
c# code 19 56
SQL server 2008 SP4 29 31
SQL Connection (Error 18456) 14 29
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

762 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

11 Experts available now in Live!

Get 1:1 Help Now