You can't. You must drop and recreate the table. There is no "alter
table drop column", as you've noticed.
In EM, the name change is really just an "sp_rename 'table.col',
'newcol'"
--
03/12/97 16:21
Ben McEwan
Geist, LLC - http://www.metis.com/~geist
bmc...@metis.com.
You can't - you'll have to create a new table.
Neil Pike MVP/MCSE (neil...@natwestuk.co.uk)
Protech Computing Ltd (MS Solution Provider)
Using Virtual Access 3.52 build 159c (32-bit) on NT 4.0 SP2
Well you can't.
What you can do is create a new table (with all the columns/data
types/lengths that you want).
Copy the data from the old table in to the new table (using a INSERT/SELECT
FROM - check the books online).
Delete the old table
Rename the new table the old table's name.
Recreate any objects the reference the old table (views, etc).
--- Brian
Kuo C Yeh <is...@isdt.taiping.com.tw> wrote in article
<01bc2e9d$7d29b600$0b9127ca@isdt>...
1. sp_rename 'mytab.mycol', xmycol, column
2. alter table mytab add mycol newdatatype
3. update table mytab set mycol = convert(varchar(30),oldcol)
might need to use a cursor here for low impact during production.
4. Drop xmycol when you have time.
Another alternative is to throw a view in front of the table.
Or add a constraint to shorten a varchar column.
DON'T FORGET to set the permissions. :)