查看当前数据库
作者:互联网
mysql:
select database()
Oracle:
SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM dual
SQL server:(先查看当前spid,再根据spid查看当前数据库名)
Select Name From SysDataBases Where DbId=(Select Dbid From SysProcesses Where Spid = @@spid)
标签:当前,查看,数据库,spid,Where,Select 来源: https://www.cnblogs.com/xdedes/p/15475665.html