The following are common SQL Server and Access operations database structures that you want to help.
The content is sorted by Eva, the incorrect and incomplete place also please put forward, thank you.
Insert Data: Insert into [table name] (field 1, Field 2) VALUES (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 three] = ' Haiwa '
New fields: Alter table [table name] ADD [field name] NVARCHAR (m) NULL
To delete a field: Alter table [table name] Drop COLUMN [field name]
To Modify a field: ALTER TABLE [table name] Alter COLUMN [field name] NVARCHAR (m) NULL
Renaming tables: (Access renames tables, refer to article: renaming tables in an Access database) sp_rename ' table name ', ' New table name ', ' OBJECT '
new constraint: Alter table [table name] ADD CONSTRAINT constraint name CHECK ([constraint field] <= ' 2000-1-1 ')
Delete constraint: Alter table [table name] Drop CONSTRAINT constraint name
Create a new default value Alter table [table name] ADD CONSTRAINT Default value name ' 51WINDOWS '. NET ' for [field name]
Delete default values Alter table [table name] Drop CONSTRAINT Default value name
Delete logs in SQL Server to reduce the size of the database file Dump TRANSACTION database name with NO_LOG
Backup log database name with NO_LOG
DBCC SHRINKDATABASE (database name)
EXEC sp_dboption ' database name ', ' autoshrink ', ' true '
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.