SQL Server commands

Source: Internet
Author: User
-- Data operation language (DML) SELECT -- retrieve data rows and columns from the database table INSERT -- add new data rows to the database table DELETE -- DELETE data rows from the database table UPDATE -- UPDATE data in the database table -- Data Definition Language (DDL)) CREATETABLE -- create a database table DROPTABLE -- from the database

-- Data operation language (DML) SELECT -- retrieve data rows and columns from the database table INSERT -- add new data rows to the database table DELETE -- DELETE data rows from the database table UPDATE -- UPDATE data in the database table -- Data Definition Language (DDL)) create table -- CREATE a database table drop table -- from database

-- Data operation language (DML)

SELECT -- fromDatabaseRetrieve data rows and columns in a table

INSERT-DatabaseAdd new data rows to a table

DELETE -- fromDatabaseDelete data rows in a table

UPDATE -- UPDATEDatabaseTable Data

-- Data Definition Language (DDL)

Create table -- CREATEDatabaseTable

Drop table -- fromDatabaseDeleting a table

Alter table -- modifyDatabaseTable Structure

Create view -- CREATE a VIEW

Drop view -- fromDatabaseDeleting a view

Create index -- isDatabaseCreate an index for a table

Drop index -- fromDatabaseDeleting Indexes

Create procedure -- CREATE a stored PROCEDURE

Drop procedure -- fromDatabaseDeleting stored procedures

Create trigger -- CREATE a TRIGGER

Drop trigger -- fromDatabaseDelete trigger

Create schema -- ForwardDatabaseAdd a new mode

Drop schema -- fromDatabaseDelete A Mode

Create domain -- CREATE a Data Value DOMAIN

Alter domain -- change DOMAIN definition

Drop domain -- fromDatabaseTo delete a domain

-- Data Control Language (DCL)

GRANT -- GRANT the user access permission

DENY-DENY User Access

REVOKE -- REVOKE User Access Permissions

-- Transaction control

COMMIT -- end the current transaction

ROLLBACK -- abort the current transaction

Set transaction -- define the data access features of the current TRANSACTION

-- Programmatic SQL

DECLARE -- set the cursor for the query

Explain -- describe the data access plan for query

OPEN -- OPEN a cursor for retrieving query results

FETCH -- retrieve a row of query results

CLOSE -- CLOSE the cursor

PREPARE -- prepare SQL statements for dynamic execution

EXECUTE -- dynamically execute SQL statements

DESCRIBE -- DESCRIBE the prepared Query

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.