×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Deleting a column from Table

Deleting a column from Table

Deleting a column from Table

(OP)
Well I add a column to a table by using ALTER table command. Now I want this column to be removed. This column does not contain any data. Tell me how to do this???

RE: Deleting a column from Table

Use the SELECT INTO command to select only the column you want from the source table INTO the new table. You can even reorganize the sequence of the columns this way. After, drop the source table and sp_rename the new table or do another SELECT INTO the original name from that new table.

You can also use this way to insert a new column "in between" existing column, like:

SELECT Ca, Cb, Cc, "MyNewCol"=convert(varchar(20)), Cd INTO MyNEWTable
FROM MyCURRENTTable

Hope this help.

Sylvain Faust
President
Sylvain Faust Intl (SFI)
880 boul. de la Carriere, Suite 130
Hull, Quebec, Canada J8Y 6T5

SQL-Programmer 2.VIII:
"The best SQL integrated development environment we've seen, earning
PC Week Labs' Analyst's Choice honors." [Oct. 26, 1998]
http://www.zdnet.com/pcweek/stories/news/0,4153,363685,00.html

Tel: (819) 778-5045, Ext. 804
Toll Free: 1-800-567-9127 (U.S. and Canada only)
Fax: (819) 778-7943 International; (617) 722-9389 U.S. only
Email: sfaust@sfi-software.com

Sylvain Faust Inc. (SFI)
Delivering SQL Solutions, Since 1988
http://www.sfi-software.com

To receive news bulletins from SFI automatically, just send a blank email to:
SFI-NEWS-SUBSCRIBE-REQUEST@peach.ease.lsoft.com

SFI Online Store:
http://store.sfi-software.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close