Solved

Delete a Column in SQL Server 2000

Posted on 2004-08-23
1
363 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
1 Comment
 
LVL 7

Accepted Solution

by:
Lori99 earned 125 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

856 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