Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.79 KB | None | 0 0
  1. -- created by sungyong 2003.11.19
  2. CREATE PROCEDURE [dbo].[UMG_ACCOUNT_INFO_DELETE]
  3. @AccountID  VARCHAR(20)
  4.  
  5. AS
  6.  
  7. DECLARE @nation tinyint
  8. DECLARE @charnum tinyint
  9. DECLARE @charid1 CHAR(21)
  10. DECLARE @charid2 CHAR(21)
  11. DECLARE @charid3 CHAR(21)
  12.  
  13. SET @charid1 = NULL
  14. SET @charid2 = NULL
  15. SET @charid3 = NULL
  16.  
  17. SELECT @nation = bNation, @charnum = bCharNum, @charid1 = strCharID1, @charid2 = strCharID2, @charid3=strCharID3
  18. FROM ACCOUNT_CHAR
  19. WHERE strAccountID = @AccountID
  20.  
  21. IF @@rowcount = 0
  22. BEGIN
  23.     RETURN
  24. END
  25.  
  26. ---- 캐릭터 삭제 처리 시작 -----------------------------------
  27. IF @charid1 IS NOT NULL
  28. BEGIN
  29.     EXEC UMG_CHAR_DELETE @AccountID, @charid1
  30. END
  31.  
  32. IF @charid2 IS NOT NULL
  33. BEGIN
  34.     EXEC UMG_CHAR_DELETE @AccountID, @charid2
  35. END
  36.  
  37. IF @charid3 IS NOT NULL
  38. BEGIN
  39.     EXEC UMG_CHAR_DELETE @AccountID, @charid3
  40. END
  41.  
  42. ---- 캐릭터 삭제 처리 끝 -----------------------------------
  43.  
  44. ---- 창고, 캐릭정보계정 백업후 삭제 처리 시작 -----------------------------------
  45. DECLARE @money INT, @dwtime INT, @strWHdata VARCHAR(1600), @strSerial VARCHAR(1600)
  46.  
  47. SELECT @money=nMoney, @dwtime=dwTime,  @strWHdata=WarehouseData, @strSerial=strSerial
  48. FROM WAREHOUSE
  49. WHERE strAccountID = @AccountID
  50.  
  51. IF @@rowcount <> 0
  52. BEGIN
  53.     INSERT INTO
  54.     DELETED_WAREHOUSE ( strAccountID,nMoney,dwTime,WarehouseData,strSerial  )
  55.     VALUES ( @AccountID, @money, @dwtime, @strWHdata, @strSerial ) 
  56.  
  57.     DELETE FROM
  58.     WAREHOUSE
  59.     WHERE strAccountID = @AccountID
  60. END
  61.  
  62. INSERT INTO
  63. DELETED_ACCOUNT_CHAR ( strAccountID, bNation, bCharNum, strCharID1, strCharID2, strCharID3  )
  64. VALUES ( @AccountID, @nation, @charnum, @charid1, @charid2, @charid3 )
  65.  
  66. DELETE FROM
  67. ACCOUNT_CHAR
  68. WHERE strAccountID = @AccountID
  69.  
  70. ---- 캐릭정보계정 백업후 삭제 처리 끝 -----------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement