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

How to change the field name in sqlsever

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

Share

Shulou(Shulou.com)05/31 Report--

Today, I will talk to you about how to change the field name in sqlsever. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

New table: create table [table name] ([automatic numbering field] int IDENTITY (1dag1) PRIMARY KEY, [field 1] nVarChar (50) default 'default' null, [field 2] ntext null, [field 3] datetime, [field 4] money null, [field 5] int default 0, [field 6] Decimal (12jue 4) default 0, [field 7] image null,)

Delete table: Drop table [table name]

Insert data: INSERT INTO [Table name] (Field 1, Field 2) VALUES (100pointer 51WINDOWS.NET')

Delete data: DELETE FROM [Table name] WHERE [Field name] > 100

Update data: UPDATE [table name] SET [field 1] = 200, [field 2] = '51WINDOWS.NET' WHERE [field 3] =' HAIWA'

New field: ALTER TABLE [table name] ADD [field name] NVARCHAR (50) NULL

Delete field: ALTER TABLE [table name] DROP COLUMN [field name]

Modified field: ALTER TABLE [table name] ALTER COLUMN [field name] NVARCHAR (50) NULL

Rename table: (Access rename table, please refer to article: rename table in Access database) sp_rename 'table name', 'new table name', 'OBJECT''

New constraint: ALTER TABLE [Table name] ADD CONSTRAINT constraint name CHECK ([constraint Field]

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