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)
2022-11-04 17:45:32
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)