1. view which created cluster index will storage data in physically。

Remember that without an index, a view does not have any physical representation of its data—rather, it just has metadata information pointing to the underlying objects. However,SQL Server will physically materialize a view’s data if you create a unique clustered index
on the view. SQL Server keeps the indexed view in sync with modifications against the underlying tables.

2. Normal function will have bad performance but inline table return table work as view and have good performance.

3. XQuery: query in sql about xml type data.

   3.1 SELECT top 1 Data
    FROM [db].[dbo].[Table] where Data.value('(/Properties/Time)[1]','DateTime') ='2012-11-06T14:45:16.245Z'

   3.2 An-Overview-of-the-SQL-Server-xml-Data-Type:

   http://www.databasejournal.com/features/mssql/article.php/3880091/An-Overview-of-the-SQL-Server-xml-Data-Type.htm

   3.3 XQuery Language Reference:

   http://msdn.microsoft.com/en-us/library/ms189075.aspx

4. Index:

   4.1 :聚集索引和非聚集索引(整理)

  http://www.cnblogs.com/aspnethot/articles/1504082.html

5. Execution plan (ctr+M)

image

6. SQL临时表

 http://www.cnblogs.com/Fskjb/archive/2009/07/06/1517989.html

 #name 临时表
 ##name: 全局表

Temporary tables are created in tempdb and: OBJECT_ID(‘tempdb..#T1’)

7. Group:

 http://msdn.microsoft.com/en-us/library/ms177673.aspx

8.SQL去掉重复记录:

 http://www.cnblogs.com/junys/archive/2012/02/07/2341530.html

 9.Union:

 http://msdn.microsoft.com/en-us/library/ms180026.aspx

 

posted on 2012-12-05 17:52  higirle  阅读(179)  评论(0编辑  收藏  举报