Featured post
- Get link
- X
- Other Apps
How to rename column name in SQL Database using sp_rename in detail
Hi friends,
In this blog I will teach you How to rename a column name in SQL database using sp_rename stored procedure.sp_rename is a stored procedure which built in MS SQL Server database.So using sp_rename we can rename table name ,column name etc in sql databases
- What is the SQL script to rename column name in SQLdatabase
- Explained renaming a column using stored procedure sp_helptext with an example
Let us create a table Customer with SQL scripts as shown below.Here i created a table Customer with create command and inserted three rows using insert command in SQL
Now let us the entries in table Customer using select command as shown below
So now let us execute the SQL script to change the name of the column in sql database table
EXEC sp_rename 'Customer.Name','CustomerName','COLUMN'
EXEC - Sql command
sp_rename - SQL Built in stored procedure
Customer.Name - Old Column Name
CustomerName - New Column Name
COLUMN - Part of SQL Script
Yes we successfully changed name of column in Customer table from Name to Customer Name.Let us confirm it by using select SQL script again as shown in the below image
I hope it is clear that How to rename a column in a table using SQL script
Thanks
Popular Posts
How to Check React Version Installed in Your System by Checking PACKAGE.JSON File and Executing Command from COMMAND PROMPT
- Get link
- X
- Other Apps
Execution failed for task ':react-native-reanimated:externalNativeBuildDebug' solved
- Get link
- X
- Other Apps
Error: Invalid `prisma.$executeRaw()` invocation: fixed using log: ["query"] option
- Get link
- X
- Other Apps
ERROR Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined
- Get link
- X
- Other Apps
app keeps stopping error solved in android studio emulator using logcat in react native project
- Get link
- X
- Other Apps