How to change the field name in sqlsever
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]