SEO Forum
 
SEO Problems SEO Knowledge Database Seo Forum Search engine optimization
  FAQ   Search   Memberlist   Usergroups   Register   Profile   Log in to check your private messages   Log in 
how to delete a column from a table?

 
Post new topic   Reply to topic    Seo FORUM » Database Related Techniques View previous topic :: View next topic  
how to delete a column from a table?
 PostPosted: Thu Mar 20, 2008 8:14 am Reply with quote  
Message
  nancy

Joined: 14 Mar 2008
Posts: 15

hi guys,

we can delete a row from a table using delete keyword like

delete from table_name where col_name='c.name'

but how to delete a column from a table after the data entry?????/


if it is possible send me the code ??????



Thanks,
Nancy.
 PostPosted: Thu Mar 20, 2008 8:30 am Reply with quote  
Message
  nancy

Joined: 14 Mar 2008
Posts: 15

hi guys,

i have got one code ...... but i am not sure this code will applicable for all databases. check it

ALTER TABLE table_name
DROP COLUMN column_name
hai
 PostPosted: Fri Mar 21, 2008 6:43 am Reply with quote  
Message
  Greenrose

Joined: 17 Mar 2008
Posts: 16

hai

i saw msg. yes. the fellow coding is applicable for all database.

ALTER TABLE table_name
DROP COLUMN column_name

regards

Laughing
hai
 PostPosted: Fri Mar 21, 2008 7:11 am Reply with quote  
Message
  Greenrose

Joined: 17 Mar 2008
Posts: 16

hai

u've delete the column using this code

ALTER TABLE table_name
DROP COLUMN column_name



u've delete the row using delete command

regards
Laughing
 PostPosted: Sat Mar 22, 2008 7:22 am Reply with quote  
Message
  nancy

Joined: 14 Mar 2008
Posts: 15

hi Green Rose,


ya, that code is correct. thanks for your reply.



regards,
nancy.
 PostPosted: Mon Feb 15, 2010 1:01 pm Reply with quote  
Message
  jaikanth123
Guest




You can delete a column using the DROP COLUMN clause of the ALTER TABLE statement.

Dropping a column deletes that column from the table definition. If CASCADE is specified, any views, indexes, and constraints dependent on that column will also be dropped. If RESTRICT is specified, and any views, indexes, or constraints are dependent on the column, the column will not be dropped and SQLCODE of -196 will be issued.
 PostPosted: Thu Aug 05, 2010 7:03 am Reply with quote  
Message
  nicole61

Joined: 05 Aug 2010
Posts: 1

Hi
This is Nicole Anderson and I've read your post Nancy.
Select the column which you want to delete and then click delete button.
The selected column will be deleted .
 PostPosted: Fri Aug 20, 2010 6:47 am Reply with quote  
Message
  roserobin

Joined: 20 Aug 2010
Posts: 4

There are Three Option You can use any one of them like You can use DROP,DELETE and TRUNCATE.It Depend on You How You want to Delete that Column form the both table like your Original table or from the Master table.
Post new topic   Reply to topic    Searchenginegenie.com Forum Index » Database Related Techniques

Page 1 of 1
All times are GMT

Display posts from previous:

  

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Search Engine Optimization SEO Company