1.查询当前数据库中的用户表 select *from sysobjects where xtype='U'; 2.获取SQL Server允许同时用户连接的最大数 SELECT @@MAX_CONNECTIONS; 3.获取当前指定数据库的连接信息 SELECT * FROM master.dbo.sysprocesses WHERE dbid IN ( SELECT dbid FROM master.dbo.sysdatabases WHERE NAME='YOURDataBaseName'
1.检索关键字:sql server内置存储过程,sql server查看系统信息 2.查看磁盘空间:EXEC master.dbo.xp_fixeddrives , --查看各个数据库所在磁盘情况SELECT DB_NAME(df.database_id) as dbName, physical_name AS DataFile, size AS 'FileSize(MB)', volume_mount_point AS Drive, AS VARCHAR) + ' GB' AS DriveS
用于记录SQL SERVER常用语法,以及内置函数. 以下语句包含: WITH 临时表语法 ROW_NUMBER()内置函数,我一般主要是用来分页.针对于查出来的所有数据做一个数字排序 分页的BETWEEN AND 我也主要是用于分页使用. WITH tab AS ( SELECT ROW_NUMBER() OVER ( ORDER BY CreateDate DESC ) AS RowNumber , DeptCode , DeptName , IsEnabled , IsType ,