Rename Table In SQL Server 2008
In this article we will see how to rename a table using in-built stored procedure.
In this article you will learn how to rename a database table.
create table emp
insert into emp values(1,'Aman')
insert into emp values(2,'Rahul')
select * from emp
Rename table emp to Employee.
To rename a table, SSMS has system stored procedure sp_rename which modifies the name of an existing table and column name or any other existing database object like view or stored procedure.
sp_RENAME 'Table_First', 'Table_Last'
Now Table emp i.e. old name. See it will give an error, because emp table is renamed to Employee.
Now select table Employee.
select * from Employee