sql-server - Azure SQL 数据库查找与特定表关联的所有数据库

标签 sql-server azure azure-sql-database

我在 Azure SQL 数据库中工作。我想找到多个数据库共有的所有表,但未能做到这一点。

我是“管理员”级用户,但是当我执行[select * from sys.tables]时 在主数据库中,我没有获得 Azure 服务器上 7 个数据库的结果。

从 Azure SQL 数据库中的所有数据库中选择所有表的方法是什么?

最佳答案

运行此查询以列出 SQL Azure DB 上的所有用户表以及每个表中的记录数

select t.name ,s.row_count from sys.tables t

join sys.dm_db_partition_stats s

ON t.object_id = s.object_id

and t.type_desc = ‘USER_TABLE’

and t.name not like ‘%dss%’

and s.index_id = 1

关于sql-server - Azure SQL 数据库查找与特定表关联的所有数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46616301/

相关文章:

sql-server - SQL Server数据工具: Error loading custom DeploymentPlanModifier: Required contributor with id could not be loaded

sql - 更新基于 3 个表的列?

c# - Azure 通知中心 : Schedule Mobile App API

azure - 外部用户访问我的 Office 365 第三方应用程序 : "a User account is not registered for the account"

azure - 是否可以在 azure VM 中运行 Docker CE?

azure - 是否可以使用 Azure 搜索将数据推送(使用 API)和拉取(使用索引器)到同一索引中?

azure - 通过 ARM 启用 Azure SQL 数据库自动调整

sql-server - 哪种存储图像的更好方法 - 文件夹或 SQL Server 作为二进制文件?

c# - 我每天大约有 3000 万行要在 SQL Server 中插入更新,我有哪些选择?

sql - 我应该使用 SQL_Variant 数据类型吗?