June 2, 2008 at 9:57 pm
hi... please reply to this query
June 2, 2008 at 10:23 pm
The SQL Standard syntax for renaming a columns is
ALTER TABLE [owner.]table-name
RENAMEcolumn-name TO new-column-name
SQL Server does not support the standard syntax including 2008. Instead the system procedure "sp_rename" must be executed with three parameters and for column renames consists of:
First parameter is the fully qualified column specifications consisting of the schema name, the table name and the column name each separated by a period.
The second parameter is the new column name.
The third parameter is the type of object and is the literal "column"
exec sp_rename ' ',',new-column-name.','column'
SQL = Scarcely Qualifies as a Language
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply