Maybe I'm wrong but I'm not sure if SQL-Server offerts support for the ALTER TABLE RENAME COLUMN statement. Instead, you should use the stored procedure sp_rename:
sp_rename 'CurrentTable.OldName', 'NewName', 'COLUMN'
For the RunSQL command, I don't know what would be the exact syntax and it's also possible that you will have to add the EXEC command at the beginning:
Exec sp_rename 'CurrentTable.OldName', 'NewName', 'COLUMN'
-- Sylvain Lafontaine, ing. MVP - Technologies Virtual-PC E-mail: http://cerbermail.com/?QugbLEWINF
"JornyO" <JornyO[ at ]discussions.microsoft.com> wrote in message news:04C5054F-5A48-492C-87F9-A36C0AD666B2[ at ]microsoft.com...
[Quoted Text] >I am trying to rename a colum using an SQL statement run in a macro using >the > RunSQL action. Some forums have told me to use the following: > > ALTER TABLE [CurrentTable] RENAME COLUMN [OldName] TO [NewName]; > > When I try to run this I get the following message: "Syntax Error in the > ALTER TABLE statement". What am I doing wrong? It seems pretty simple to > me, and many other forums have offered this advice for doing this.
|