/ 查询最大的表TOP10 / -beginif object_id('tempdb..#Tab') is not nulldrop table #TabCREATE TABLE #Tab (NAME nvarchar(100) ,ROWS VARCHAR(100) ,reserved nvarchar(100) ,Data nvarchar(100) ,index_size nvarchar(18) ,Unused nvarchar(18) )GOINSERT #Tab EXEC SP_MSFOREACHTABLE 'EXEC sp_spaceused "?"'SELECT top 10 a.NAME as '名称',a.rows ,a.Data as '容量',a.index_size as '索引大小'-- CONVERT(INT,REPLACE(DATA,'KB','')) 按容量排序FROM #Tab a ORDER BY CONVERT(INT,REPLACE(DATA,'KB','')) DESC/ 查询最大的表TOP10 / -end/ 查询死锁 / -begi
登录SSMSEXEC sp_configure 'show advanced options', 1 GO RECONFIGUREGO EXEC sp_configure 'xp_cmdshell', 1 RECONFIGURE GOExEc xp_cmdshell 'mkdir C:\DataDB\'
RonTon
挨踢大叔