Promotic
WikipediaLinkedInYoutubeTwitterFacebook

sp_rename - statement of language DB_MSSQL

Description:
Change the name of a user created object (table, column, etc.) in the current database.
Syntax:

sp_rename

  [@objname =] 'object_name',

  [@newname =] 'new_name'

  [, [@objtype =] 'object_type']

 
@objname Original name of the object (in case of a column, the name of the column must be included).
@newname New name of the object.
@objtype Type of the renamed object ('COLUMN', 'DATABASE', 'INDEX', 'OBJECT' or 'USERDATATYPE').
See also:
Example:
Change the name of a column from time to when in the table data.
EXEC sp_rename 'data.time', 'when', 'COLUMN'
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice