?
Solved

Delete a Column in SQL Server 2000

Posted on 2004-08-23
1
Medium Priority
?
366 Views
Last Modified: 2008-03-06
I am trying to write SQL code to delete a column in MS SQL Server 2000 via the SQL Query Analyzer.  For example, the following code adds a column to a table:

ALTER TABLE dbo.t_Auto
ADD BIRTH_DATE datetime null

How would I write a query to delete this field.  I thought it should look like this:

ALTER TABLE dbo.t_Auto
DELETE BIRTH_DATE datetime null

But I am getting a syntax error.  Also tried:

ALTER TABLE dbo.t_Auto
DROP BIRTH_DATE datetime null

Same syntax error.  I know this is an easy question.  Help!
0
Comment
Question by:tawalsh3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 7

Accepted Solution

by:
Lori99 earned 500 total points
ID: 11874696
You don't need the datatype information for a drop.

Try:

ALTER TABLE dbo.t_Auto
DROP COLUMN BIRTH_DATE
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question