[SQL] Can't edit - No primary or unique key. menu

User Tag List

Results 1 to 10 of 10
  1. #1
    noodleman1's Avatar Member
    Reputation
    6
    Join Date
    Oct 2006
    Posts
    74
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [SQL] Can't edit - No primary or unique key.

    Hi,

    I was trying to edit the world -> playcreateinfo_spells table but got stuck because of the following error, using HeidiSQL:



    Now I'm unable to edit anything in the table, can't even modify default entries. I am able to add new rows though, but this will often result in a replacement by "65535" for the spellid column, especially when entering high numbers (= Spell IDs). Can't delete the row afterwards.


    Help appreciated

    Edit:
    Video here -> http://v6.tinypic.com/player.swf?file=ip84fp&s=6
    Last edited by noodleman1; 01-15-2010 at 12:54 PM.

    [SQL] Can't edit - No primary or unique key.
  2. #2
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Right click on the table and press alter. Change it so that it has a key field or the key field can't be null, problem solved.

  3. #3
    noodleman1's Avatar Member
    Reputation
    6
    Join Date
    Oct 2006
    Posts
    74
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by stoneharry View Post
    Right click on the table and press alter. Change it so that it has a key field or the key field can't be null, problem solved.
    Thanks for your quick reply , could you explain the last step once more? I don't see any key field related options in the alter window..



    Or should I switch to Navicat to perform this fix?

  4. #4
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I use SQLyog, I don't know with navicat or hedisql. In a minute I will upload a screenshot, just give me a minute to download a SQL server. I'll edit this post.


    Last edited by stoneharry; 01-15-2010 at 11:27 AM.

  5. #5
    noodleman1's Avatar Member
    Reputation
    6
    Join Date
    Oct 2006
    Posts
    74
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, odd. I think mine are configured that way. Found something similar in HeidiSQL:
    (changed the default value to 1 to try that, as Not Null and default = 0 seemed contradictionary, but didn't work.)

    Last edited by noodleman1; 01-15-2010 at 11:43 AM.

  6. #6
    noodleman1's Avatar Member
    Reputation
    6
    Join Date
    Oct 2006
    Posts
    74
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I seem to be able to edit in SQLYog just fine, and the changes work (as in, affect the game). Some spell IDs (I think anything > 65535 ) still get changed into 65535 though, preventing me from adding the spells I want. Is there like a setting for "max entry" in the table?


  7. #7
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    It's probably changed automaticaly be the core when you run the worldserver. :/ I don't know.

  8. #8
    Algorithm's Avatar Member
    Reputation
    175
    Join Date
    Mar 2008
    Posts
    395
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just run this query

    ALTER IGNORE TABLE playcreateinfo_spells ADD PRIMARY KEY(indexid);

    problem solved

  9. #9
    noodleman1's Avatar Member
    Reputation
    6
    Join Date
    Oct 2006
    Posts
    74
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Algorithm View Post
    just run this query
    Ah, so this forced on a primary key? I am able to edit things now, but the key settings are probably wrong, as every entry needs to be unique (so I can't add multiple spells for the same class/race combo because that would result in a duplicate entry for indexid). For this reason, it has also deleted all other entries which weren't unique, leaving my table with only one spell per class/race (=indexid), oh well. Do you know how to change these "unique" settings using a query?

    Thanks!

    Last edited by noodleman1; 01-16-2010 at 05:33 AM.

  10. #10
    noodleman1's Avatar Member
    Reputation
    6
    Join Date
    Oct 2006
    Posts
    74
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone? :-/

Similar Threads

  1. [QUESTION] Can Model Editing in retail wow get you baned?
    By Teddy Bear Love in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 10-25-2007, 08:08 AM
  2. Can you edit Geosets?
    By Fayth in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 09-13-2007, 11:31 AM
  3. How can I edit the arena ?
    By Svempy in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 08-09-2007, 07:40 AM
  4. Can not edit post - Mod please help
    By DJRehab in forum Community Chat
    Replies: 3
    Last Post: 08-05-2007, 04:09 PM
  5. how can i edit mounts?
    By Creeper in forum World of Warcraft Model Editing
    Replies: 3
    Last Post: 10-07-2006, 11:23 AM
All times are GMT -5. The time now is 07:17 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search