SQL Rename Table

OBJECTIVE

In this chapter you will learn:

How to rename table
Syntax of rename table
Example of rename table

 

How to rename table

If you want to rename table then you can do it with the help of sp_rename command. SQL Server provides the facility to rename the name of the table which is created in the database.

 

Syntax of rename table

sp_rename old_table_name, new_table_name

Example of rename table

 

 

rename table example

Guide:

When you run the given statement in SQL Server then the name of the table (employee) will changed as employee_detail as it in statement. See the demo-

 

 

employee-detail table
 

 

SUMMARY

In this chapter you have learned how to rename table, one example is also given for your better guide so now you can rename the table name. In the next chapter you will learn about drop table.


Leave a Reply

Your email address will not be published. Required fields are marked *