五月综合激情婷婷六月,日韩欧美国产一区不卡,他扒开我内裤强吻我下面视频 ,无套内射无矿码免费看黄,天天躁,日日躁,狠狠躁

新聞動(dòng)態(tài)

在SQLServer上查看SQL語句的執(zhí)行時(shí)間的方法

發(fā)布日期:2022-01-29 12:45 | 文章來源:CSDN

1:下面這種是比較簡(jiǎn)單的查詢方法,通過查詢前的時(shí)間和查詢后的時(shí)間差來計(jì)算的

復(fù)制代碼 代碼如下:

declare @begin_date datetime
declare @end_date datetime
select @begin_date = getdate()
<這里寫上你的語句...>
select @end_date = getdate()
select datediff(ms,@begin_date,@end_date) as '用時(shí)/毫秒'


2:下面這種方法比較全面,將執(zhí)行每個(gè)語句時(shí)采取的步驟作為行集返回,通過層次結(jié)構(gòu)樹的形式展示出來
復(fù)制代碼 代碼如下:

set statistics profile on
set statistics io on
set statistics time on
go
<這里寫上你的語句...>
go
set statistics profile off
set statistics io off
set statistics time off

有時(shí)候我們需要知道一段SQL語句執(zhí)行的時(shí)間有多長。下面是其中一種辦法。

declare @preDate Datetime
select @preDate = getdate()
print @preDate
select datepart(ms,@preDate) as ms, datepart(ss,@preDate) as second,datepart(mi,@preDate) as minute
go
--需要測(cè)試的SQL語句
go
declare @preDate Datetime
SELECT @preDate= getdate()
select datepart(ms,@preDate) as ms, datepart(ss,@preDate) as second,datepart(mi,@preDate) as minute

這樣可以知道你的語句到底運(yùn)行了多少毫秒。

國外服務(wù)器租用

版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。

相關(guān)文章

實(shí)時(shí)開通

自選配置、實(shí)時(shí)開通

免備案

全球線路精選!

全天候客戶服務(wù)

7x24全年不間斷在線

專屬顧問服務(wù)

1對(duì)1客戶咨詢顧問

在線
客服

在線客服:7*24小時(shí)在線

客服
熱線

400-630-3752
7*24小時(shí)客服服務(wù)熱線

關(guān)注
微信

關(guān)注官方微信
頂部