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

Sybase question

Options
  • 31-05-2001 5:10pm
    #1
    Registered Users Posts: 7,468 ✭✭✭


    For those of you interested:

    You can't drop a column in Sybase. What you can do though is:
    1>SELECT name, avatar, p45netshyte INTO TempTable FROM P45net
    2>GO
    1>DROP TABLE P45net
    2>GO
    1>SELECT name, avatar INTO boards FROM TempTable
    2>GO
    1>DROP TABLE TempTable
    2>GO
    1>COMMIT
    2>GO

    This will select from one table into another and drop the column p45shyte. Seem pretty simple doesn't it. It's taken 3 of us all afternoon to work that out. mad.gif Sheesh, I deserve a pint.


    [This message has been edited by Evil Phil (edited 31-05-2001).]


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    I need to know one of two things either:

    a) how do I drop a column of the database, all the usualls don't work.

    b) select from one table and intsert into another i.e.
    > CREATE TABLE boards AS SELECT * FROM p45net
    > GO



  • Closed Accounts Posts: 2 deadbeef


    The SELECT INTO syntax looks pretty similar to MS SQL Server. You could try :


    Alter Table P45Net Drop Column p45netshyte



  • Moderators, Social & Fun Moderators Posts: 10,501 Mod ✭✭✭✭ecksor


    MS SQL is based on sybase, and they both use T-SQL as their database language.


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    DROP COLUMN isn't supported by Sybase so sometimes it works but mostly it doesn't, and if it f*cks up your on you own. I didn't work for us so I wrote the above.

    I didn't know Sybase used T-SQL, come to think of it, I don't know Sybase wink.gif.


Advertisement