Syntax to change the name of the table:
SP_RENAME 'OLD TABLENAME','NEW TABLENAME'
Example:
SP_RENAME 'EMP','EMPLOY'
The above stored procudure changes the name of EMP table to EMPLOY
Syntax to change the name of the column
SP_RENAME 'TABLEOLDCOLUMNNAME','NEW COLUMNNAME'
Example:
SP_RENAME 'STUDENT.ADR', ADDRESS
The above stored procudure changes the name of ADR column to ADDRESS in STUDENT table.

No comments:
Post a Comment