OTHERS
SELECT a.usecounts as '被執行的次數'
, a.cacheobjtype--Adhoc代表每次執行的結果都會不一樣,Proc代表是Stored Procedure,Prepared不用理會
, a.objtype
, b.text as 'SQL Script'
, c.query_plan
FROM sys.dm_exec_cached_plans a
CROSS APPLY sys.dm_exec_sql_text(a.plan_handle) as b
CROSS APPLY sys.dm_exec_query_plan(a.plan_handle) as c
SELECT *
FROM Table
ORDER BY Column_1 OFFSET 2 ROW FEATCH NEXT 3 ROW ONLY--跳過前面兩筆資料且從第二筆之料之後只撈3筆
◎ 清除QUERY CATCH
CHECKPOINT
GO
DBCC DROPCLEANBUFFERS
GO
DBCC FREEPROCCACHE
GO
--SET NOCOUNT ON
SELECT GETUTCDATE() AS '倫敦時間'
, GETDATE() AS '(臺灣)當地時間'