column name change

  • i have copied data from columnA to other columnB in a table.

    I want to rename ColumnA as something else and rename ColumnB to ColumnA

    How do i do it?

  • sql server management studio makes it easy. just open the table, its columns, and right-click the column (or click it twice).

    from the command line, use sp_rename

    EXEC sp_rename

    @objname = 'table_name.old_column_name',

    @newname = 'new_column_name',

    @objtype = 'COLUMN'

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply