?
Solved

TSQL auto renewal subscription handling

Posted on 2014-12-30
1
Medium Priority
?
116 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 28

Accepted Solution

by:
Ryan McCauley earned 2000 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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how the fundamental information of how to create a table.

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