Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

SQL add columns, modify columns, delete columns

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

SQL statement to add columns, modify columns, delete columns

1. Add columns:

Alter table tableName add columnName varchar (30)

2.1. Modify the column type:

Alter table tableName alter column columnName varchar (4000)

2.2. Change the name of the column:

EXEC sp_rename 'tableName.column1',' column2' (change the name of the column1 column named tableName to column2)

3. Delete the column:

Alter table tableName drop column columnName

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report