Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

SQL Drop function

  • 12-02-2008 02: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, Registered Users 2 Posts: 31 markkilpatrick


    try

    DROP TABLE StaffLinkToAct;


  • Registered Users, Registered Users 2, Paid Member Posts: 2,032 ✭✭✭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, Registered Users 2 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