Thursday, 6 January 2022

Alter Table Add, Remove/Delete/Drop, Modify/Change/Rename Column Name In Sql Server

1/06/2022 - By Pranav Singh 0

In this article i will show you how you can add new column, Remove/Delete/Drop existing column and modify table column name in an existing sql server database table. So for this first create a new database in ms sql server and add a table. 


SQL Table

Add Column: Now we will check query for adding a new column.


query to alter table column in sql

Now run the query to check the output.



Remove/Delete/Drop Column: In this we will check how we can remove a specific column using query.


Remove/Delete/Drop, Modify/Change Column Name In Sql Server


Now run the above query and check the output. Here you can we Colum2 and Colum4 have been removed.


Remove/Delete/Drop, Modify/Change Column Name In Sql Server

Modify Column: Now we will check how we can rename the column name using sql query. for modifying column name we will user sp_Raname to rename the column name of the table.


query to modify column name in ms sql


In above query TestTable is the table name. Now lets check the table.


Renamed column name in sql

Tags:
About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Global Classified : Connectseekers.com
© 2014 aspdotnet-pools.com Designed by Bloggertheme9.
back to top