Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Column From A Table 1

Status
Not open for further replies.

dbinfoweb

Technical User
Nov 20, 2001
59
0
0
US
I am just wondering how I can remove a column from a table. I thought it would be alter table (table name) alter column (column name). But it gave me an “Incorrect Syntax” error. Thanks in advance for any help.
 
Just have to be aware that some of the newer alter commands are non-logged which may invalidate dumps. Since behind the scenes its rebuilding table with select..into type of logic....
 
Wow, I did not know that Alter table commands are not logged.

Is there any where I can read info on logged and non-logged operations?

Thanks.
 
I think the manuals have it in there somewhere.

But for some of the alters such as when changing lock structures, it will invalidate the log due to being a non-logged transaction....

Not sure off hand which are or are not logged, so thats why I thought I would toss out idea to double check...
 
Please be aware that alter table drop column is not supported in version before 12 of ASE! You are going to have problems if you use alter table drop column pre v 12!

The safest bet is to rename the current table to <table>_prev. Create a new table in the image of old table without the affected column. Do insert select from the prev table to the new table. Then build primary key, indexes, triggers etc.

good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top