Advertisement
EnemyGPP

Untitled

Jan 28th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. -- ----------------------------
  2. -- Procedure structure for WZ_SetSkinsBought
  3. -- ----------------------------
  4.  
  5. ALTER PROCEDURE [dbo].[WZ_SetSkinsBought]
  6. @in_CustomerID int,
  7. @in_WeaponItemID int,
  8. @in_Skins int,
  9. @in_Selected int
  10. AS
  11. BEGIN
  12. SET NOCOUNT ON;
  13. -- routine body goes here, e.g.
  14. -- SELECT 'Navicat for SQL Server'
  15.  
  16. if(not exists(select * from WeaponSkins where CustomerID=@in_CustomerID and WeaponItemID=@in_WeaponItemID and Skins=0)) begin
  17. insert into WeaponSkins (
  18. CustomerID,
  19. WeaponItemID,
  20. Skins,
  21. Selected
  22. ) values (
  23. @in_CustomerID,
  24. @in_WeaponItemID,
  25. 0,
  26. @in_Selected
  27. )
  28. END
  29.  
  30. if(not exists(select * from WeaponSkins where CustomerID=@in_CustomerID and WeaponItemID=@in_WeaponItemID and Skins=@in_Skins)) begin
  31. insert into WeaponSkins (
  32. CustomerID,
  33. WeaponItemID,
  34. Skins,
  35. Selected
  36. ) values (
  37. @in_CustomerID,
  38. @in_WeaponItemID,
  39. @in_Skins,
  40. @in_Selected
  41. )
  42. select 0 as ResultCode
  43. return
  44. end
  45.  
  46. update WeaponSkins set Selected=@in_Selected where CustomerID=@in_CustomerID and WeaponItemID=@in_WeaponItemID
  47.  
  48. select 0 as ResultCode
  49. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement