Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2004
    Posts
    21

    Unanswered: renaming a table

    how do i rename a table? i tried making a copy of it (select * into copy from original), but it turns out that doesn't work either... =(

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    The method for renaming objects depends on which database engine you are using.

    -PatP

  3. #3
    Join Date
    Oct 2003
    Posts
    357
    In SQL 2000
    Code:
    Select * into newTable from OldTable
    drop Table OldTable
    Madhivanan

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    in sql server
    Code:
    sp_rename 'tablename' , 'newname'
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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