Computing.Net > Forums > Programming > sql alter table query

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

sql alter table query

Reply to Message Icon

Name: mark
Date: March 19, 2003 at 08:06:23 Pacific
OS: w2k
CPU/Ram: p4 512mb
Comment:

easy one

if this works

alter table sheet1

drop column field1

;

why does this not

Alter table sheet1

drop column field1,
drop column field2

;

2nd drop column says error.

cant sus it,

cheers for any help



Sponsored Link
Ads by Google

Response Number 1
Name: gpp
Date: March 19, 2003 at 08:08:27 Pacific
Reply:

If your trying to show us some code, it didnt post.


0

Response Number 2
Name: mark
Date: March 19, 2003 at 08:18:26 Pacific
Reply:

that is the code,

its a sql query to remove various columns from a table


0

Response Number 3
Name: gpp
Date: March 19, 2003 at 09:23:10 Pacific
Reply:

Sorry, the spacing threw me off.

This code should work...

alter table TABLE_NAME DROP column ONE, DROP column TWO, DROP column THREE;

of course this wont work if your dropping all columns in the table.. to do that, you have to use DROP TABLE. In other words, there must be at least one column left over.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: sql alter table query

Add field to recordset VB6 www.computing.net/answers/programming/add-field-to-recordset-vb6/6760.html

Create SQL table in VB www.computing.net/answers/programming/create-sql-table-in-vb/10175.html

SQL Query www.computing.net/answers/programming/sql-query/16559.html