資源描述:
《索引的創(chuàng)建及使用(sqlserver 2005)》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、為指定表或視圖創(chuàng)建關(guān)系索引,或?yàn)橹付ū韯?chuàng)建XML索引??稍谙虮碇刑钊霐?shù)據(jù)前創(chuàng)建索引??赏ㄟ^指定限定的數(shù)據(jù)庫名稱,為另一個(gè)數(shù)據(jù)庫中的表或視圖創(chuàng)建索引。?Transact-SQL語法約定語法[sql]?viewplaincopy1.?Create?Relational?Index?CREATE?[?UNIQUE?]?[?CLUSTERED?
2、?NONCLUSTERED?]?INDEX?index_name???2.????ON?
3、?DESC?]?[?,...n?]?)??
4、?3.????[?INCLUDE?(?column_name?[?,...n?]?)?]??4.????[?WITH?(??[?,...n?]?)?]??5.????[?ON?{?partition_scheme_name?(?column_name?)???6.?????????
5、?filegroup_name???7.?????????
6、?default???8.?????????}??9.????]??10.[?;?]??11.??12.
7、=??13.{??14.????[?database_name.?[?schema_name?]?.?
8、?schema_name.?]???15.????????table_or_view_name??16.}??17.??18.?::=??19.{??20.????PAD_INDEX??=?{?ON?
9、?OFF?}??21.??
10、?FILLFACTOR?=?fillfactor??22.??
11、?SORT_IN_TEMPDB?=?{?ON?
12、?OFF?}??23.?
13、?
14、?IGNORE_DUP_KEY?=?{?ON?
15、?OFF?}??24.??
16、?STATISTICS_NORECOMPUTE?=?{?ON?
17、?OFF?}??25.??
18、?DROP_EXISTING?=?{?ON?
19、?OFF?}??26.??
20、?ONLINE?=?{?ON?
21、?OFF?}??27.??
22、?ALLOW_ROW_LOCKS?=?{?ON?
23、?OFF?}??28.??
24、?ALLOW_PAGE_LOCKS?=?{?ON?
25、?OFF?}??29.??
26、?MAXDOP?=?max_degree_of_para
27、llelism??30.}??31.??32.Create?XML?Index?CREATE?[?PRIMARY?]?XML?INDEX?index_name???33.????ON?
28、?PATH?
29、?PROPERTY?}?]??36.????[?WITH?(??[?,...n?]?)?]
30、??37.[?;?]??38.??1.
31、?schema_name.?]???4.????????table_name??5.}??6.??7.?::=??8.{???9.????PAD_INDEX??=?{?ON?
32、?OFF?}??10.??
33、?FILLFACTOR?=?fillfactor??11.??
34、?SORT_IN_TEMPDB?=?{?ON?
35、?OFF
36、?}??12.??
37、?STATISTICS_NORECOMPUTE?=?{?ON?
38、?OFF?}??13.??
39、?DROP_EXISTING?=?{?ON?
40、?OFF?}??14.??
41、?ALLOW_ROW_LOCKS?=?{?ON?
42、?OFF?}??15.??
43、?ALLOW_PAGE_LOCKS?=?{?ON?
44、?OFF?}??16.??
45、?MAXDOP?=?max_degree_of_parallelism??17.}??18.??19.Backward?Compatible?Relational?Index?
46、?20.Important???The?backward?compatible?relational?index?syntax?structure?will?be?removed?in?a?future?version?of?SQL?Server.?Avoid?using?this?syntax?structure?in?new?development?wo