问题标签 [information-schema]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
sql-server - REFERENTIAL_CONSTRAINTS 中 UNIQUE_CONSTRAINT_NAME 的值不正确
我使用INFORMATION_SCHEMA
具有以下查询的视图集列出给定表的所有 FK 约束:
一切都运行得很好,但是对于一个特定的约束,UNIQUE_CONSTRAINT_NAME
列的值是错误的,我需要它来从引用的列中找到额外的信息。基本上,对于大多数行,它UNIQUE_CONSTRAINT_NAME
包含引用表中唯一约束(或 PK)的名称,但对于一个特定FK
的,它是一些其他唯一约束的名称。
我放弃并重新创建了 FK - 没有帮助。
我的假设是元数据以某种方式被搞砸了。有没有办法重建元数据,以便INFORMATION_SCHEMA
视图实际显示正确的数据?
编辑 1:示例数据库结构
我希望UNIQUE_CONSTRAINT_NAME
是MY_PARENT_TABLE_PK
,但我得到的是MY_PARENT_TABLE_u_nci_ID_LongName
。
查看结构后,我发现实际上该列上有 2 个UNIQUE
约束 -PK
和MY_PARENT_TABLE_u_nci_ID_LongName
. 所以真正的问题可能应该是:为什么它需要一些其他的唯一索引而不是 PK?
sql-server - 在与某个表的关系的“多”端查找所有表和字段
在 Sql Server 2005 中,我有一个主表,以及通过几个一对多关系与该主表相关的其他几个表。如何在“多”端找到与主表中的主键相关的所有表和字段?
我知道我可以通过从 INFORMATION_SCHEMA 查询视图来提取此信息,但我不知道在哪里可以找到此信息。
谢谢
information-schema - information_schema 数据库代表什么?
我在mysql中有一个数据库。
但是当我登录 phpMyAdmin 时,它会显示另一个名为 information_schema 的数据库。
该数据库是否始终与一个数据库一起存在?
我的意思是说mysql中存在的每个数据库都有一个information_schema的副本,还是每个mysql服务器都有一个名为information_schema的数据库?
如果我修改这个 information_schema 数据库,它将如何影响我当前的数据库?
database - Table design for user's information as well as login credentials?
Initially I would like to ask you to forget about hashing passwords or w/e related to passwords, this question is not related to securing passwords, etc and I do know/understand how this should be done.
What is the best approach to store the data in question, considering performance on read/write - to build one or more tables?
Single table, for example:
Table users: id, username, password, hash, email, group, access, address, phone, parents, ts_created, ts_update
Multiple tables, for example:
Table users: id, username, password, hash, email, group, access, ts_created, ts_update
Table user's information: id, user_id, address, phone, parents, ts_created, ts_update
What if your user's information fields may grow along the time - how should you deal with it ?
For example new fields: birthday_date, comments, situation
Will having 2 tables be slower on queries than having a single table ?
If having multiple tables in this case is only for maintaining a good design with separated data, does that mean it is not useful at all for performance reasons ?
If you want real sql examples let me know and I will scrap something to update this.
postgresql - 在 pg_catalog 表中找到的字段的 NUMERIC 精度和比例在哪里?
在 PostgreSQL 中,表结构的列数据存储在 pg_attribute 中,在 pg_class 中有几个字段,在 pg_attrdef 中有几个字段。
但是我看不到存储在任何地方的 NUMERIC 字段类型的精度或比例。
它可以在 INFORMATION_SCHEMA 表中找到,但我试图避免它们,因为它们不使用 oid 来轻松加入 pg_catalog 表。
所以问题是:postgreSQL 系统表中的列精度和比例存储在哪里?
sql-server - SQL Server 2008 授予 information_schema.columns 权限
我有一系列从数据库中选择数据的存储过程。我有一个角色 (cctc_reader),它具有对程序授予的执行权限。其中一个过程调用另一个存储过程,该过程又被称为recControl_system_option
查询Information_schema.columns
。
问题是在这个过程中查询
select column_name from information_schema.columns where table_name = 'recControl_manager'
不返回任何记录。cctc_reader 具有以下权限:
- 每个选择过程
recControl_system_option
所以理论上这应该有效。在 dbo 下运行时我没有问题。
如果我将 db_datareader 授予 cctc_reader 查询很好,但我不想授予所有表的读取器权限(因此我使用存储过程)。我已尝试按照某些文章中的建议授予对 Master 数据库中 Information_schema 的 Select 权限,但仍然无法使其正常工作。
有什么建议么?
stored-procedures - 解决我表列名称的存储过程
我需要一个存储过程,它的参数有表名(varchar),它返回这个特定表中的列名。
有可能的 ?我考虑了一些从表中检索这些名称的 SELECT,但我在 SQL 方面很弱:/
我补充说我使用 Firebird 1.5:/
mysql - 如何获取在 MySQL 中没有特定列的表列表
我需要在 MySQL 中有一个表列表,这些表没有“创建”或“修改”列,所以如果不存在,我可以添加它们。我怎样才能做到这一点?
提前感谢您的任何帮助/提示。
sql - SQL Server:如何从 information_schema 获取外键引用?
在 SQL Server 中,如何从外键中获取引用的表 + 列名?
注意:不是键所在的表/列,而是它所引用的键。
例子:
当 key[FA_MDT_ID]
在 table 中时[T_ALV_Ref_FilterDisplay]
。指[T_AP_Ref_Customer].[MDT_ID]
例如在创建这样的约束时:
作为输入,我需要[T_AP_Ref_Customer].[MDT_ID]
得到[T_ALV_Ref_FilterAnzeige].[FA_MDT_ID]
sql-server - information_schema.columns 向我的 SQL Server 代理返回 0 行
我只是陷入了这个问题,不幸的是,即使在谷歌搜索时我也找不到任何东西......
我在 SQL Server 2005 数据库上运行以下查询:
我在不同的数据库中得到了 @TableCount 的不同结果,例如:
..ETC
但是当我让我的 SQL Server 代理在相同的数据库上运行相同的查询时,他总是得到 0(零)作为结果。即没有例外,没有错误消息表明他的访问权限有问题 - 结果只是简单的 0(零)。
如果您有任何想法,请帮助:
- 我的 SQL Server 代理可能有什么问题?
- 无论问题是什么,为什么我没有收到任何错误消息?
提前感谢任何想法/建议!