Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

SQL Drop function

Options
  • 12-02-2008 3:28pm
    #1
    Closed Accounts Posts: 5,240 ✭✭✭


    Im trying to delete a field in a table, i just created the table so i know it exits.

    ALTER TABLE Officers
    DROP StaffLinkToAct
    Go

    I get this error:
    Server: Msg 3728, Level 16, State 1, Line 4
    'StaffLinkToAct' is not a constraint.
    Server: Msg 3727, Level 16, State 1, Line 4
    Could not drop constraint. See previous errors.

    Is it trying to tell me this field does not exits? Odd seing as i just created it.


Comments

  • Registered Users Posts: 31 markkilpatrick


    try

    DROP TABLE StaffLinkToAct;


  • Registered Users Posts: 1,986 ✭✭✭lynchie


    try

    DROP TABLE StaffLinkToAct;

    Thats statement is to drop the table. He wants to drop a column.

    Try Alter Table Officers Drop column StaffLinkToAct; I know that works in MySQL


  • Closed Accounts Posts: 5,240 ✭✭✭Endurance Man


    Cheers for the replies lads, that worked a treat lynchie.


  • Registered Users Posts: 31 markkilpatrick


    lynchie wrote: »
    Thats statement is to drop the table. He wants to drop a column.

    Try Alter Table Officers Drop column StaffLinkToAct; I know that works in MySQL

    Should have read it twice before replying. :)


Advertisement