sql-server-2012 - 如何使用表名查找数据库名?
问题描述
我发现我的系统中存在表名,我使用了以下查询;
select * from sys.tables where name = '%openpotab%';
但是如何使用表名找到数据库名呢?
在此先感谢, Bhavesh
解决方案
你可以使用:
select DB_NAME(DB_ID()), * from sys.tables where name LIKE '%openpotab%';
推荐阅读
- swift - 如何使用 UIDatePicker 输入管理具有两个 UITextField 的 firstResponder
- java - 在聚合类中使用克隆的最佳实践
- authentication - Python imaplib:无论凭据是否正确,雅虎帐户的身份验证都失败
- python - 从 shell 脚本向 python 传递参数
- google-sheets - 将 Google 表格查询结果从一行拆分为两行
- python - 如何使用 Python 从字符串中删除插入符号(^@)?
- python - 我该如何处理“只能将str(不是“StringVar”)连接到str”
- javascript - 使用 transition.end() 承诺链接转换
- sql - 在第二列中存储日期加上 45 天
- python - Pandas strip 函数也会删除数值