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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deleting a column with some data?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have tried to delete a column but I always have the following error:

DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0104N An unexpected token "escuelaID" was found following "E my_table
DROP". Expected tokens may include: "CONSTRAINT". SQLSTATE=42601

And this is the sql statement that I'm using:
ALTER TABLE my_table DROP escuelaID

I'm on a DB2 system, I'll hope that someone can help me....
Thanks
 
It looks as if DB2 doesn't support dropping columns from existing tables.
 
This depends on your version of SQL Server. If you are running SQL 7 then open enterprise manager, go down the tree to the table and right click the mouse on the table. Select table design and open it. Select the field that you want to delete and delete it. Be sure to check for any foreign keys that may be connected to that field. Hope this helps.
 
Hi,
maybe the column is a primary key, and in this case you must drop the key at the first. John Fill
 
Try this..

ALTER TABLE my_table DROP COLUMN escuelaID

May it help you..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top