30 likes | 163 Views
دستور Select. SELECT [ALL|DISTINCT] [TOP ( <expression> ) < column list > [FROM < source table(s)/view(s) >] [WHERE < restrictive condition >] [GROUP BY < column name or expression using a column in SELECT list >] [HAVING < restrictive condition based on the GROUP BY results >]
E N D
دستور Select SELECT [ALL|DISTINCT] [TOP (<expression>) <column list> [FROM <source table(s)/view(s)>] [WHERE <restrictive condition>] [GROUP BY <column name or expression using a column in SELECT list>] [HAVING <restrictive condition based on the GROUP BY results>] [ORDER BY <column list>] [[FOR XML {RAW|AUTO|EXPLICIT|PATH [(<element>)]}[, XMLDATA][, ELEMENTS][, BINARY base 64]] [OPTION (<query hint>, [, ...n])]
دستور CREATE DATABASE • CREATE DATABASE <database name> • [ON [PRIMARY] • ([NAME = <’logical file name’>,] • FILENAME = <’file name’> • [, SIZE = <size in kilobytes, megabytes, gigabytes, or terabytes>] • [, MAXSIZE = size in kilobytes, megabytes, gigabytes, or terabytes>] • [, FILEGROWTH = <kilobytes, megabytes, gigabytes, or terabytes|percentage>])] • [LOG ON • ([NAME = <’logical file name’>,] • FILENAME = <’file name’> • [, SIZE = <size in kilobytes, megabytes, gigabytes, or terabytes>] • [, MAXSIZE = size in kilobytes, megabytes, gigabytes, or terabytes>] • [, FILEGROWTH = <kilobytes, megabytes, gigabytes, or terabytes|percentage>])] • [ COLLATE <collation name> ] • [ FOR ATTACH [WITH <service broker>]| WITH DB_CHAINING • ON|OFF | TRUSTWORTHY ON|OFF] • [AS SNAPSHOT OF <source database name>][;]
دستور CREATE TABLE • CREATE TABLE [database_name.[owner].]table_name • (<column name> <data type> • [[DEFAULT <constant expression>] • |[IDENTITY [(seed, increment) [NOT FOR REPLICATION]]]] • [ROWGUIDCOL] • [COLLATE <collation name>] • [NULL|NOT NULL] • [<column constraints>] • |[column_nameAS computed_column_expression] • |[<table_constraint>] • [,...n] • ) • [ON {<filegroup>|DEFAULT}] [TEXTIMAGE_ON {<filegroup>|DEFAULT}]