非常实用的MSSQL语句
1.查询数据库的内存SQL_GET_MEMORY ='SELECT name, value, value_in_use, [description] FROM sys.configurations WHERE name = "max server memory
(MB)" ORDER BY name OPTION (RECOMPILE)'
2.查询用户权限,SERVER级别
SQL_GET_USER_RIGHT_SERVER = "SELECT * FROM sys.fn_my_permissions(NULL, 'SERVER')"
3.查询用户权限,DATABASE级别
SQL_GET_USER_RIGHT_DB = "SELECT * FROM sys.fn_my_permissions(NULL, 'DATABASE')"
4.切换数据库主备关系
SQL_CHANGE_MASTER = "alter database elbert08 set partner failover"
页:
[1]