SQL Rename Table

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

sp_rename employee, employee_detail
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.

More Articles

 

Share your thought



PLEASE DISABLE ADBLOCKER AND SUPPORT US!

Please support us by enabling ads on this page. Refresh

YOU DON'T LIKE ADS, WE ALSO DON'T LIKE ADS!
 
But we have to show ads on our site to keep it free and updated. We have to pay huge server costs, domain costs, CDN Costs, Developer Costs, Electricity and Internet Bill. Your little contribution will encourage us to regularly update this site.