Tutorialsteacher

Follow Us

Articles
  • C#
  • C# OOP
  • ASP.NET Core
  • ASP.NET MVC
  • LINQ
  • Inversion of Control (IoC)
  • Web API
  • JavaScript
  • TypeScript
  • jQuery
  • Angular 11
  • Node.js
  • D3.js
  • Sass
  • Python
  • Go lang
  • HTTPS (SSL)
  • Regex
  • SQL
  • SQL Server
  • PostgreSQL
  • MongoDB
  • SQL - Getting Started
  • What is SQL
  • Create Table
  • ALTER TABLE Statements
  • Rename Columns
  • Modify Column Type
  • Drop Columns
  • Rename Tables
  • Drop Tables
  • Insert Statement
  • Update Statement
  • Delete Statement
  • Truncate Statement
  • Merge Statement
  • Null Value
  • Select Query
  • WHERE Clause
  • GROUP BY Clause
  • HAVING Clause
  • ORDER BY Clause
  • SQL - Inner Join
  • SQL - Left Join
  • SQL - Right Join
  • SQL - Full Join
  • SQL - BETWEEN
  • SQL - IN
  • SQL - LIKE
  • SQL - INTERSECT
  • SQL - MINUS
  • SQL - UNION
  • SQL - UNION ALL
  • SQL - DISTINCT
  • SQL - ANY, SOME
  • SQL - ALL
  • SQL - AVG()
  • SQL - COUNT()
  • SQL - MAX()
  • SQL - MIN()
  • SQL - SUM()
Entity Framework Extensions - Boost EF Core 9
  Bulk Insert
  Bulk Delete
  Bulk Update
  Bulk Merge

SQL - Rename Tables in the Database

Different databases support the different syntax to rename a table.

Use the following ALTER TABLE RENAME script to rename table names in the MySQL, PostgreSQL, and SQLite database.

SQL Script: Rename Table in MySQL, PostgreSQL, and SQLite
ALTER TABLE Employee RENAME TO Emp;

The following statement will rename Employee table to TempEmployee in the Oracle database.

SQL Script: Rename Table in Oracle
RENAME Employee TO TempEmployee;

Use the sp_rename built-in stored procedure to rename a table in the SQL Server database.

SQL Script: Rename Table in SQL Server
sp_rename Employee, emp;

Make sure that the original table name is correct, and the new name has not been used with other database objects; otherwise, it will raise an error.

TUTORIALSTEACHER.COM

TutorialsTeacher.com is your authoritative source for comprehensive technologies tutorials, tailored to guide you through mastering various web and other technologies through a step-by-step approach.

Our content helps you to learn technologies easily and quickly for learners of all levels. By accessing this platform, you acknowledge that you have reviewed and consented to abide by our Terms of Use and Privacy Policy, designed to safeguard your experience and privacy rights.

[email protected]

ABOUT USTERMS OF USEPRIVACY POLICY
copywrite-symbol

2024 TutorialsTeacher.com. (v 1.2) All Rights Reserved.