SQL statement for creating a table index createindex ()

Source: Internet
Author: User
Tags createindex mssql server
SQL create TABLE index createindex () Statement mssqlserver method Syntax: create [index type] index name on table name (column name) withfillfactor fill factor value 0 ~ 100go instance createnonclusteredindexix_test_tname -- create a non-clustered index ontest (tname) & nbsp; SQL statement to create a table index create index ()

Mssql server Method
Syntax:
Create [index type] index name
On Table Name (column name)
With fillfactor = fill factor value 0 ~ 100
Go


Instance

Create nonclustered index ix_test_tname -- create a non-clustered index
On test (tname) -- creates an index for the tname field of the test table
With fillfactor = 30 -- fill factor is 30%
Go

Select * from test (index = ix_test_tname) where tname = 'A'


Method

Mysql index creation syntax

Create [unioun | fulltext | spatial] index indexname [using indextype] on

Tablename (tablenamecol)

Index_col_name:

Col_name [(length)] [asc | desc]

For more details, see :-

Index.htm

Instance

Create index instance
This document creates a simple index named "personindex" in the lastname column of the person table.

:

Create index personindex
On person (lastname)
If you want to index the values in a column in descending order, you can add the reserved word desc after the column name:

Create index personindex
On person (lastname desc)
If you want to index more than one column, you can list the names of these columns in parentheses, separated by commas:

Create index personindex
On person (lastname, firstname)

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.