Pinal is an experienced and dedicated professional with a deep commitment to flawless customer service. To freely share his knowledge and help others build their expertise, Pinal has also written more than 5,500 database tech articles on his blog at. Pinal has authored 13 SQL Server database books and 40 Pluralsight courses. He holds a Masters of Science degree and numerous database certifications. Pinal Dave is an SQL Server Performance Tuning Expert and independent consultant with over 17 years of hands-on experience. You can see the same data now available in new table named “Table_Last” To check that the new renamed table exist in database run script: The Messages shows an error “Invalid object name ‘Table_First’.” “Table_First” will no longer be available in database. Now, the table name “Table_First” is renamed as “Table_Last”. We can change the table name too with the same command.įollowing fig. verify that the column name has been changed. You can see the column name “Name” is now changed to “ NameChange“.įollowing fig. Name', ' NameChange', 'COLUMN'įollowing Fig. Now, to change the Column Name from “Name” to “ NameChange” we can use command: A small table with name “ Table_First” is created. Renaming database table column to new name.Įxample uses AdventureWorks database. In both the cases we will first see existing table. Renaming database table column to new name.This article demonstrates two examples of renaming database object. The script for renaming any object (table, sp etc) : Here is a video demonstrating the discussion I often get requests from blog reader for T-SQL script to rename database table column name or rename table itself.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |