Question regarding delete queries.

ogg13

Registered User.
Local time
Yesterday, 21:46
Joined
Jan 30, 2007
Messages
49
Im pretty new to database structure, terms and whatnots. Im developing a database for my organization solely based off of my limited knowledge of coding structures and languages. The question may seem a little novice, and just wanted to preface it with that 8)

Delete Queries seem to delete records based off of certain criteria. The question is this: Is there any way to use a delete query to delete a COLUMN in an entire table rather than a record? I dont even need criteria to be there, im basically importing information from an excel spreadsheet that is a common format for our organization and trying to remove info that isnt pertinent to our portion of the business. So basically theres a few columns that really just dont make a difference to us.

Any help would be much appreciated. Thank you!
 
That's a data definition query. Go to design view on a new query without adding any tables or anything else. From there, go to the drop-down menus and select Query -> SQL Specific -> Data Definition. You're brought to an SQL entry window, and this is how you structure what you want:

ALTER TABLE your_table_name DROP COLUMN name_of_column_to_drop;

Note that you don't get any warnings or anything when you execute this sort of query. It just runs and it's done (and permanent), so make sure you have the table and column names right on the first shot. :)

You can go here if you want more information.
 
Nice! Thanks a ton!
 

Users who are viewing this thread

Back
Top Bottom