SQL Server的一些系統變數

2021-05-22 09:16:31 字數 1050 閱讀 7098

sql server的一些系統變數

sp_configure 'min server memory' --伺服器最小記憶體

gosp_configure 'max server memory' --伺服器最大記憶體'

gosp_configure 'index create memory'--建立索引占用的記憶體

go--sp_configure 'min  memory per query'--每次查詢占用的最小記憶體

--獲取磁碟讀寫情況

select

@@total_read as '讀取磁碟的次數',

@@total_write as '寫入磁碟的次數',

--  @@total_error as '磁碟寫入錯誤數',

getdate() as '當前時間'

--獲取i/o工作情況

select 

--  @@id_busy,--sql自上次啟動以來的用於執行輸入和輸出操作的時間

@@timeticks, --每個時鐘週期對應的微秒數

--  @@id_busy*@@timeticks as 'i/o 操作毫秒數',

getdate() as '當前時間'

--檢視sql sever cpu活動,工作情況

select

@@cpu_busy,--自上次啟動以來的工作時間

@@timeticks, --每個時鐘週期對應的微秒數 

@@cpu_busy*cast(@@timeticks as float)/1000 as 'cpu工作時間(秒)',

--  @@idie*cast(@@timeticks as float)/1000 as 'cpu空閒時間(秒)'

getdate() as '當前時間'

--獲取網路資料報統計資訊

select

getdate() as '當前時間',

@@pack_received as'輸入資料報數量',

@@pack_sent as '輸出資料報數量'--,

--  @@packet_error as '錯誤包數量'

sqlserver 一些系統自帶指令

exec sp databases 列出資料庫 exec sp server info exec sp stored procedures 環境中的儲存過程列表 exec sp tables 所有可以成為select物件的列表 exec sp password new newpassword log...

sqlServer 一些常用的

1.插入資料 insert into t casename name,plantid,factoryid,mouldclassid,casequery values 旋轉蓋 1,1,297,8 2.表中新增字段 alter table table name add column name datat...

SQL Server 一些技巧

keylife富翁筆記 作者 hongyuan 標題 sql server 一些技巧 關鍵字 分類 sql server 2000 密級 私有 評分 回覆 0,閱讀 4 1 重置 identity 欄位的起始值 dbcc checkident table name reseed,0 2 壓縮資料庫 ...