Solved

Delete a Column in SQL Server 2000

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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
Change this SQL to get all nodes 3 40
SQL Syntax 6 43
SQL - Ordering Supervisor Hierarchy 2 15
Please explain Equi-join 3 16
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

730 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