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_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"
本文转自 SimplePoint 51CTO博客,原文链接:http://blog.51cto.com/2226894115/1888361,如需转载请自行联系原作者