Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. USE [OblakLive123]
  2. GO
  3.  
  4. /****** Object: StoredProcedure [disk].[DiskAccountDetails] Script Date: 13-Nov-19 11:35:00 ******/
  5. SET ANSI_NULLS ON
  6. GO
  7.  
  8. SET QUOTED_IDENTIFIER ON
  9. GO
  10.  
  11.  
  12.  
  13. CREATE PROCEDURE [disk].[DiskAccountDetails]
  14. (
  15. @AccountID bigint,
  16. @IsA1User bit out
  17. )
  18. AS
  19.  
  20. BEGIN
  21.  
  22.  
  23. SELECT
  24. ASP.Active, ASP.CreatedDate, ASP.ExpirationDate,
  25. spp.Period, spp.Price, spp.PricePerGB,
  26. asps.Name,
  27. sp.Name
  28. FROM [OblakLive123].[disk].[AccountStoragePlan] AS ASP
  29. INNER JOIN [OblakLive123].[disk].[StoragePlanPackage] AS SPP
  30. ON ASP.StoragePlanPackageID = SPP.ID
  31. INNER JOIN [OblakLive123].[disk].[StoragePlan] AS SP
  32. ON spp.StoragePlanID = sp.ID
  33. INNER JOIN [OblakLive123].[lookup].AccountStoragePlanStatus AS ASPS
  34. ON ASP.Status = ASPS.ID
  35. WHERE ASP.AccountID = @AccountID
  36.  
  37. SET @IsA1User = (SELECT mt.Active
  38. FROM [OblakLive123].[disk].Mtel AS MT WHERE mt.AccountID = @AccountID)
  39.  
  40. IF(@IsA1User IS NULL)
  41. BEGIN
  42. SET @IsA1User = 0;
  43. END
  44. ELSE
  45. BEGIN
  46. SET @IsA1User = 1;
  47. END
  48.  
  49. END
  50. GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement