I have following
Create Table TblSubscription
(
SubscriptionId int identity(1,1) Primary key,
UserId INT NOT NULL Foreign key References TblAppUser(UserId),
PackageId INT NOT NULL Foreign key References TblPackages(PackageID),
StartDate datetime,
FinishDate datetime,
mxnotification int,
mxarticles int,
mxvideos int,
mxevent int,
mxallias int,
IsActive bit,
IsPaid bit
);
INSERT INTO TblSubscription (UserId,PackageId,StartDate,FinishDate,mxnotification,mxarticles,mxvideos,mxevent,mxallias,IsActive,IsPaid)
VALUES(@UserID,@PackageId,GetDate(),GETDATE()+30,@notific,@articles,@mxvideos,@mxevent,@mxallias,0,0) SELECT @@IDENTITY
I want that column name startdate= GEtdate() and finshdate=getdate()+30 equals. it automaically sets IsActive = false for that Userid
And Ifmxnotification,mxarticles,mxvideos,mxevent,mxallias =0 it also automatically sets IsActive =false for that Userid
How can i do that. is there any function or other stuff available.