Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. drop the primary key using a query

drop the primary key using a query

Scheduled Pinned Locked Moved Database
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    prasadbuddhika
    wrote on last edited by
    #1

    i tried to drop the primary key of the table using

    alter table customer drop primary key

    but it says Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword 'primary'. what might be the problem

    S W 2 Replies Last reply
    0
    • P prasadbuddhika

      i tried to drop the primary key of the table using

      alter table customer drop primary key

      but it says Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword 'primary'. what might be the problem

      S Offline
      S Offline
      Shrinivas Singh
      wrote on last edited by
      #2

      try this alter table customer drop constraintname constraintname is the name of the primary key constraint

      1 Reply Last reply
      0
      • P prasadbuddhika

        i tried to drop the primary key of the table using

        alter table customer drop primary key

        but it says Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword 'primary'. what might be the problem

        W Offline
        W Offline
        Wayne Porter
        wrote on last edited by
        #3

        I have the same problem too. What are you suppose to use.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups