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.

Sybase question

  • 31-05-2001 05:10PM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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