Results 1 to 5 of 5

Thread: sql constraint

  1. #1
    Master Chief Petty Officer Bers's Avatar
    Join Date
    Jul 2005
    Location
    Verona
    Posts
    2.085

    Default sql constraint

    C'è qualcuno che cortesemente mi spiega a cosa serve questo comando dell'sql? è nella sintassi

    nome_campo tipo constraint nome primary key,
    [url=http://narutofantasyheart.forumcommunity.net/?t=9346526&st=0]

  2. #2
    Tanek's Avatar
    Join Date
    Apr 2004
    Location
    Milano, Midgard
    Posts
    11.225

    Default

    Rende il/i campo/i la primary key della tabella.
    E' il vincolo piu' importante dell'SQL ed equivale all'unione di NOT NULL e UNIQUE.

    Parlare di SQL e non sapere cos'e' una chiave primaria pero' non è bello.

    Tanek™: Game Designer & Algorithm Mastermind, Team Leader & SW Engineer and Dungeon Master!
    "Datte Foco"™ and "Ma KITTESENCULA"™ are registered trademarks of Tanek Entertainment Inc.
    ‎"One of these days, scientists will discover that second X chromosome contains nothing but nonsense and twaddle." - Sheldon Cooper
    Per non dimenticare:
    Spoiler


  3. #3
    Lieutenant Gate's Avatar
    Join Date
    Jan 2004
    Location
    Vietato fumareeeeee
    Posts
    4.516

    Default

    o
    _
    O

  4. #4
    Master Chief Petty Officer Bers's Avatar
    Join Date
    Jul 2005
    Location
    Verona
    Posts
    2.085

    Default

    Quote Originally Posted by Tanek View Post
    Rende il/i campo/i la primary key della tabella.
    E' il vincolo piu' importante dell'SQL ed equivale all'unione di NOT NULL e UNIQUE.

    Parlare di SQL e non sapere cos'e' una chiave primaria pero' non è bello.

    so cosa sono le chiavi primarie solo che noi usiamo primary key in parte al campo
    [url=http://narutofantasyheart.forumcommunity.net/?t=9346526&st=0]

  5. #5
    Tanek's Avatar
    Join Date
    Apr 2004
    Location
    Milano, Midgard
    Posts
    11.225

    Default

    Mah..

    Cmq la sintassi corretta è:

    ALTER TABLE nome_tabella
    ADD CONSTRAINT nome_chiave PRIMARY KEY (nome_campo);

    (Google, secondo link copiato/incollato)

    Tanek™: Game Designer & Algorithm Mastermind, Team Leader & SW Engineer and Dungeon Master!
    "Datte Foco"™ and "Ma KITTESENCULA"™ are registered trademarks of Tanek Entertainment Inc.
    ‎"One of these days, scientists will discover that second X chromosome contains nothing but nonsense and twaddle." - Sheldon Cooper
    Per non dimenticare:
    Spoiler


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[Output: 54.77 Kb. compressed to 46.42 Kb. by saving 8.35 Kb. (15.24%)]