] table_name [ AS File Table ] ( [ ,...n ] [ PERIOD FOR SYSTEM_TIME ( system_start_time_column_name , system_end_time_column_name ) ] ) [ ON ] [ TEXTIMAGE_ON ] [ FILESTREAM_ON ] [ WITH ( [ FILESTREAM ] [ COLLATE collation_name ] [ SPARSE ] [ MASKED WITH ( FUNCTION = ' mask_function ') ] [ CONSTRAINT constraint_name [ DEFAULT constant_expression ] ] [ IDENTITY [ ( seed,increment ) ] [ NOT FOR REPLICATION ] [ GENERATED ALWAYS AS ROW [ HIDDEN ] ] [ NULL | NOT NULL ] [ ROWGUIDCOL ] [ ENCRYPTED WITH ( COLUMN_ENCRYPTION_KEY = key_name , ENCRYPTION_TYPE = , ALGORITHM = ' AEAD_AES_256_CBC_HMAC_SHA_256' ) ] [ [ , ...n ] ) ] [ ON ] | [ FOREIGN KEY ] REFERENCES referenced_table_name [ ( ref_column ) ] [ ON DELETE ] [ ON UPDATE ] [ NOT FOR REPLICATION ] | CHECK [ NOT FOR REPLICATION ] ( logical_expression ) ] [ , ...n ] ) ] [ ON ] | FOREIGN KEY ( column [ ,...n ] ) REFERENCES referenced_table_name [ ( ref_column [ ,...n ] ) ] [ ON DELETE ] [ ON UPDATE ] [ NOT FOR REPLICATION ] | CHECK [ NOT FOR REPLICATION ] ( logical_expression ) --Memory optimized CREATE TABLE Syntax CREATE TABLE [database_name . The expression can be a noncomputed column name, constant, function, variable, and any combination of these connected by one or more operators.
For example, a computed column can have the definition: cost AS price * qty.
Using WITH ENCRYPTION prevents the view from being published as part of SQL Server replication.
SCHEMABINDING Binds the view to the schema of the underlying table or tables.
Views or tables that participate in a view created with the SCHEMABINDING clause cannot be dropped unless that view is dropped or changed so that it no longer has schema binding. Also, executing ALTER TABLE statements on tables that participate in views that have schema binding fail when these statements affect the view definition.
Creates a virtual table whose contents (columns and rows) are defined by a query.Department_History, DATA_CONSISTENCY_CHECK = ON ) ); CREATE SCHEMA History GO CREATE TABLE dbo.Department ( Department Number char(10) NOT NULL PRIMARY KEY CLUSTERED, Department Name varchar(50) NOT NULL, Manager ID int NULL, Parent Department Number char(10) NULL, Sys Start Time datetime2 GENERATED ALWAYS AS ROW START HIDDEN NOT NULL, Sys End Time datetime2 GENERATED ALWAYS AS ROW END HIDDEN NOT NULL, PERIOD FOR SYSTEM_TIME (Sys Start Time, Sys End Time) ) WITH ( MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA, SYSTEM_VERSIONING = ON ( HISTORY_TABLE = History.If Note In the columns for the view, the permissions for a column name apply across a CREATE VIEW or ALTER VIEW statement, regardless of the source of the underlying data.For example, if permissions are granted on the Sales Order ID column in a CREATE VIEW statement, an ALTER VIEW statement can name the Sales Order ID column with a different column name, such as Order Ref, and still have the permissions associated with the view using Sales Order ID. The statement can use more than one table and other views.