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

What are the Sql Server and Access operation database structure Sql statements

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly explains the "Sql Server and Access operation database structure Sql statements have", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "Sql Server and Access operation database structure Sql statements which are" it!

New table:

Create table [table name]

(

[automatic numbering field] int IDENTITY (1) 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 (12pm 4) default 0

[field 7] image null

)

Delete the table:

Drop table [table name]

Insert data:

Insert INTO [Table name] (Field 1, Field 2) VALUES (100 recording 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 fields:

Alter TABLE [Table name] ADD [Field name] NVARCHAR (50) NULL

Delete a field:

Alter TABLE [table name] Drop COLUMN [field name]

Modify the 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'

Create a 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