(1):Select Name From Master..SysDataBases Where DbId=(Select Dbid From Master..SysProcesses Where Spid = @@spid)

(2):--NoteMessage 为数据库名称
if db_id('NoteMessage')=(Select Dbid From Master..SysProcesses Where Spid = @@spid)
print 'OK'

相关文章:

  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2022-01-09
  • 2022-02-01
  • 2021-04-06
猜你喜欢
  • 2021-10-12
  • 2021-06-09
  • 2021-08-11
  • 2021-08-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案