Changing the Ranking Column in DB.

Results 1 to 14 of 14
  1. #1
      Phoenix is offline
    ModeratorRank
    Mar 2009 Join Date
    6,890Posts

    idea Changing the Ranking Column in DB.

    I just realized that my Ranking column in the Character table has ranks of all the characters set to 1 but my website's ranking page shows the ranks properly maybe because of the script.

    They all got set to 1 / started getting set to 1 after I tried No Life X's MPOG web once, where we had to execute the following script:

    Code:
    /*
       September 10 200918:52:52
       User: Nolife_x
       Server: PC-DE-GERRY\SQLEXPRESS
       Database: GunZDB
       Application: Fix the player ranking page.
    */
    
    /* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
    BEGIN TRANSACTION
    SET QUOTED_IDENTIFIER ON
    SET ARITHABORT ON
    SET NUMERIC_ROUNDABORT OFF
    SET CONCAT_NULL_YIELDS_NULL ON
    SET ANSI_NULLS ON
    SET ANSI_PADDING ON
    SET ANSI_WARNINGS ON
    COMMIT
    BEGIN TRANSACTION
    GO
    ALTER TABLE dbo.Character ADD
    	Ranking int NULL
    GO
    ALTER TABLE dbo.Character ADD CONSTRAINT
    	DF_Character_Ranking DEFAULT 1 FOR Ranking
    GO
    COMMIT
    I'm guessing it's somewhere in the red part. I could change the column and make it number the characters' ranking in increasing order but that wouldn't be the actual rank.

    So how do I change to column back to normal so that the Ranking column shows proper ranks of all the characters?

    Please help me out, I have no clue on how to do it and really need to fix it.

    Thanks.


  2. #2
    Account Upgraded | Title Enabled! fuxpro321 is offline
    MemberRank
    Jun 2010 Join Date
    266Posts

    Re: Changing the Ranking Column in DB.

    the script Saved my ass =)

  3. #3
    DRGunZ 2 Creator wesman2232 is offline
    MemberRank
    Jan 2007 Join Date
    Erie, PALocation
    4,872Posts

    Re: Changing the Ranking Column in DB.

    well, your ranking system probably has nothing to do with the ranking column. I'm pretty sure you could probably just delete it, but check your ranking scripts to see if it uses it before you do.

    4,000th post :P

  4. #4
    Account Upgraded | Title Enabled! Hymn is offline
    MemberRank
    Jan 2007 Join Date
    269Posts

    Re: Changing the Ranking Column in DB.

    Congrats :)

    Yeah, the script probably just uses the kill/death columns in your database and ranks them based on the total score. Or probably experience, who knows look through the script.

  5. #5
    DRGunZ 2 Creator wesman2232 is offline
    MemberRank
    Jan 2007 Join Date
    Erie, PALocation
    4,872Posts

    Re: Changing the Ranking Column in DB.

    Quote Originally Posted by Hymn View Post
    Congrats :)

    Yeah, the script probably just uses the kill/death columns in your database and ranks them based on the total score. Or probably experience, who knows look through the script.
    exactly what I was thinking, but you never know. I think one of the webs got the ranking from the experience table then updated the ranking column accordingly, but I'm not sure lol. Thanks too.

  6. #6
    Account Upgraded | Title Enabled! Hymn is offline
    MemberRank
    Jan 2007 Join Date
    269Posts

    Re: Changing the Ranking Column in DB.

    Quote Originally Posted by wesman2232 View Post
    exactly what I was thinking, but you never know. I think one of the webs got the ranking from the experience table then updated the ranking column accordingly, but I'm not sure lol. Thanks too.
    Heh that would be more high speed than I could figure gunz developers would think about.

  7. #7
    Member Zarif is offline
    MemberRank
    Jul 2010 Join Date
    My Fly World ;pLocation
    59Posts

    Re: Changing the Ranking Column in DB.

    Congrats wesman, and gj Phoenix.

  8. #8
      Phoenix is offline
    ModeratorRank
    Mar 2009 Join Date
    6,890Posts

    Re: Changing the Ranking Column in DB.

    I've changed the ranking page so that it arranges the characters by their Exp, so it's in perfect order.

    But the player info script / in-game Ranking (08 files) reads the ranking from the Character table's ranking column, and hence I need a fix for it.

  9. #9
    DRGunZ 2 Creator wesman2232 is offline
    MemberRank
    Jan 2007 Join Date
    Erie, PALocation
    4,872Posts

    Re: Changing the Ranking Column in DB.

    hmm, well you could try changing the script to have the default ranking to be null.

  10. #10
      Phoenix is offline
    ModeratorRank
    Mar 2009 Join Date
    6,890Posts

    Re: Changing the Ranking Column in DB.

    Yeah I wanted to undo the script. I'm not sure how exactly I can do it.

  11. #11

    Re: Changing the Ranking Column in DB.

    Code:
    GO
    ALTER TABLE dbo.Character DROP CONSTRAINT DF_Character_Ranking
    GO
    UPDATE Character SET Ranking = NULL
    Give it a try.
    Last edited by Linear88; 10-07-10 at 04:59 AM.

  12. #12
      Phoenix is offline
    ModeratorRank
    Mar 2009 Join Date
    6,890Posts

    Re: Changing the Ranking Column in DB.

    Quote Originally Posted by Linear88 View Post
    Code:
    GO
    ALTER TABLE dbo.Character DROP CONSTRAINT DF_Character_Ranking
    Give it a try.
    I executed it but the ranking of all characters is still '1' in the Ranking column. Do I have to log into those accounts and select the characters or create new ones to check?

  13. #13

    Re: Changing the Ranking Column in DB.

    Edited my post.

  14. #14
      Phoenix is offline
    ModeratorRank
    Mar 2009 Join Date
    6,890Posts

    Re: Changing the Ranking Column in DB.

    It set the ranks of existing characters to 'NULL' and even new characters are set to 'NULL' regardless of the kills they make and level up.



Advertisement