Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USE [OblakLive123]
- GO
- /****** Object: StoredProcedure [disk].[DiskAccountDetails] Script Date: 13-Nov-19 11:35:00 ******/
- SET ANSI_NULLS ON
- GO
- SET QUOTED_IDENTIFIER ON
- GO
- CREATE PROCEDURE [disk].[DiskAccountDetails]
- (
- @AccountID bigint,
- @IsA1User bit out
- )
- AS
- BEGIN
- SELECT
- ASP.Active, ASP.CreatedDate, ASP.ExpirationDate,
- spp.Period, spp.Price, spp.PricePerGB,
- asps.Name,
- sp.Name
- FROM [OblakLive123].[disk].[AccountStoragePlan] AS ASP
- INNER JOIN [OblakLive123].[disk].[StoragePlanPackage] AS SPP
- ON ASP.StoragePlanPackageID = SPP.ID
- INNER JOIN [OblakLive123].[disk].[StoragePlan] AS SP
- ON spp.StoragePlanID = sp.ID
- INNER JOIN [OblakLive123].[lookup].AccountStoragePlanStatus AS ASPS
- ON ASP.Status = ASPS.ID
- WHERE ASP.AccountID = @AccountID
- SET @IsA1User = (SELECT mt.Active
- FROM [OblakLive123].[disk].Mtel AS MT WHERE mt.AccountID = @AccountID)
- IF(@IsA1User IS NULL)
- BEGIN
- SET @IsA1User = 0;
- END
- ELSE
- BEGIN
- SET @IsA1User = 1;
- END
- END
- GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement