Solved

Delete a Column in SQL Server 2000

Posted on 2004-08-23
1
357 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now