How to usa ALTER COLUMN to change a column name

G

Guest

Hi,

I´m trying to change the column name using ALTER TABLE, but I didn´t find
any example how can I do that. Could you help me?
 
G

Guest

Try a different approach

Function FunctionName()

Dim MyDb as Dao.database
Dim MyRec as Dao.TableDef
Dim FldName as DAO.Field

Set MyDb=codedb()
Set MyRec = MyDb.TableDefs("TableName")
Set FldName = Myrec!FieldName

FldName.name = "New name"

End Function
 
P

peregenem

Robson_Brasil said:
I´m trying to change the column name using ALTER TABLE

ALTER TABLE Customers ADD Telephone VARCHAR(24)
;
UPDATE Customers SET Telephone = Phone
;
ALTER TABLE Customers DROP Phone
;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SQL Change Column name 5
Alter Table Question 2
Maybe Update Query? 2
Set default value to 0 with ALTER TABLE 1
ALTER COLUMN syntax 2
ALTER COLUMN 3
ALTER TABLE query 1
Add new column 2

Top