Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2009
    Posts
    7

    Unanswered: modify or change primary key??

    can primary key be modified or changed? as far as i have seen there were no options to change or modify. it can only be dropped and added! if its true please tell me why it cant be modified or changed?
    thanks n cheers!

  2. #2
    Join Date
    Jun 2007
    Posts
    197

    Smile

    Quote Originally Posted by sandyssn
    can primary key be modified or changed? as far as i have seen there were no options to change or modify. it can only be dropped and added! if its true please tell me why it cant be modified or changed?
    thanks n cheers!
    Primary cannot be modified due to this will be refrence to many other table
    You have to make lots of modification

  3. #3
    Join Date
    Dec 2008
    Posts
    135
    if u want to drop the primary key u have to drop the foreign key constraint which references with primary key and then drop the primary key constriant

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by ankur02018
    Primary cannot be modified due to this will be refrence to many other table
    actually, that's not true

    do a search for ON UPDATE CASCADE

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Jun 2007
    Posts
    197

    Smile

    Quote Originally Posted by r937
    actually, that's not true

    do a search for ON UPDATE CASCADE

    I understood for changes in primary key column name or data type
    which can also be change by droping and recreating reference key

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by r937
    actually, that's not true

    do a search for ON UPDATE CASCADE

    From the data perspective that's true, but I think the question was intended from the schema perspective. Thats a different problem.

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •