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”