Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2012
    Posts
    15

    Post Unanswered: alter table name error and table column

    ----change In the name of Table 5 Table 6
    Use test
    GO
    ALTER TABLE NAME tablo5 RENAME TO tablo6;
    GO

    but error messages::
    Msg 102, Level 15, State 1, Line 1
    Incorrect syntax near 'tablo5'.
    ------------------
    ------------------
    ----tablo4 d1 ==> d11 change.
    Use test
    GO
    ALTER TABLE tablo4 RENAME COLUMN d1 TO d11;
    GO
    error messages::

    Msg 102, Level 15, State 1, Line 1
    Incorrect syntax near 'RENAME'

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Yo9u need to use the system stored procedure sp_rename. This will work for both the column and the table names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •