Trevor Dwyer - SQL Server MVP
Quote:> i need to the syntax for dropping a column from a table.
If the column you want to drop has an index defined on it
you have to drop the index before dropping
DROP INDEX TableAA.IX_TableAA
If the column you want to drop is a foreign key
you have to drop the foreign key constraint before dropping
ALTER TABLE <tableName>
DROP CONSTRAINT <constraintNAme>
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
> Best Regards
> Trevor Dwyer - SQL Server MVP
> > i need to the syntax for dropping a column from a table.
> > Thanx
Always knew that sex, * and/or rock 'n' roll would get to you one day
> > There is no actual command to do this - however if you use enterprise
> > Manager to remove the column and then click on the script icon you can
> > what actually takes place when you do remove the column. You can then
> > and paste this sql into Query Analyzer.
> > Best Regards
> > Trevor Dwyer - SQL Server MVP
> > > i need to the syntax for dropping a column from a table.
> > > Thanx
I have a common column exists in all my tables and now I don't need this
column any more. Is there a way to mess delete the column in all tables,
instead of openning each individual table and delete it. I have about 500
Thanks for the advise.