问题标签 [system-tables]

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.

0 投票
2 回答
73 浏览

sql-server - SQL Server 系统表标识 crysis / SYSOBJECTS 表 ID 接近 int 最大值

SYSOBJECTS 表有一个 int 类型的标识列。但是 ID 列中的值越来越接近 int 最大值。我想当它达到最大值时将无法创建任何对象。

例如,有没有办法改变该表以将 ID 列转换为 BIGINT?或者有什么工具可以解决这个问题?

0 投票
0 回答
58 浏览

recaptcha - 如何找到确切的系统表名来禁用 Drupal 中的 recaptcha 模块?需要帮助

如何找到确切的系统表名来禁用 Drupal 中的 recaptcha 模块?我的 Drupal 版本是 8.5.5

我遵循 Drupal 官方文档并运行命令:
UPDATE system SET status = 0 WHERE name = "recaptcha"; 但是看到一个错误“ERROR 1146 (42S02): Table 'drupal.system' doesn't exist,所以想知道我是否使用了正确的表名?非常感谢。

0 投票
1 回答
172 浏览

stored-procedures - 如何从 Netezza DEFINITION_SCHEMA 复制数据 [忽略 bytea 错误]

我正在尝试分析 Netezza 服务器上存储过程中使用的代码。

第一步是获取存储过程中包含的定义/代码 - 这可以通过以下任一方式轻松完成:

使用系统视图

或使用基表[观点指向此表]

现在,一旦我对 PROCEDURESOURCE 列进行一些分析并尝试将此信息写入表中,我总是会收到以下错误:

错误:IBM Netezza SQL 不支持类型“bytea”

复制此错误的简单方法是执行以下操作

我已经确定 DEFINITION_SCHEMA."_T_PROC" 中有一列 bytea(列名 = PROBIN)

但是,我没有选择此列,所以我不确定为什么会收到此错误

任何人都可以帮助解决如何将 PROCEDURESOURCE 复制到新表中并绕过“bytea”错误

谢谢

0 投票
1 回答
149 浏览

sql - Teradata - 如何按表和按月获取数字访问权限

我正在尝试获取每个表和每个月的用户编号。

我正在尝试获得读取访问权限(选择并且没有更新删除)你知道是否可以使用 dbc.tables 之类的视图来获得它?

PS : 英语不是我的母语 => 抱歉

0 投票
2 回答
259 浏览

sql-server - How to tell whether a column is of sysname type

It's a common question how to find the columns in a table by querying the system columns. For example SQL server query to get the list of columns in a table along with Data types, NOT NULL, and PRIMARY KEY constraints gives a query which works in most cases. However, a column of type sysname is returned as plain nvarchar. In Management Studio (SSMS) scripting out a table definition will correctly give the sysname type. And so will sp_columns. But how can I find whether a column is of sysname type using an SQL query against the system tables? (I don't want to run sp_columns separately for each table.)

In case you are wondering what the sysname type is to start with, What is SYSNAME data type in SQL Server? gives some info.

To give more detail:

Then running

reports type_name=sysname. But a simple query against sys.columns gives just varchar:

I had a look at the definition of sp_columns to see if I could do the same thing. It looks up the column details in a system table sys.spt_columns_odbc_view. But this is apparently some top secret internal table that can only be queried from a direct administrator connection (DAC) or from SSMS. (See What is spt_columns_odbc_view and why is it not accessible?) The sp_columns proc manages to query this view even though I am not running it from Management Studio or over a DAC. But I don't know how to repeat that trick in my own code.

Is there some other way to tell whether a column is of sysname type?

0 投票
2 回答
44 浏览

sql - SQL - 使用联合对 2 个或更多列进行分组计数需要超过 2 秒

给定一个表,我们称它为 performance6a - 表结构 >> student_id | 数学 | 历史 | 语言 | 科学

表格内容 - 性能 6a

我需要编写一个生成如下报告的查询 -

预期的查询输出

组数基于 2 个类别,在这种情况下,通过或失败,然后是主题。

请注意,这些操作是在无法规范化或重新设计的系统表上执行的。两个类别的数量都可以增长(类别 - 通过/失败可以增加到 100 和类别 - 主题可以增加到 ~5k)

我试过的:

这个查询给了我正确的输出,但是执行时间超过了 2s。我正在寻找优化查询的想法。

0 投票
2 回答
336 浏览

sql - 扩展事件 connection_id 与 client_connection_id

大家好,我想找到一种方法来识别为 Microsoft SQL Server 中的扩展事件执行的查询(仅使用执行的查询过滤扩展事件)

如果我像这样查询 SQL Server 中的系统视图:

我得到了当前执行的查询的 connection_id,它在 SQL Server 重新启动之前是唯一的。

但是扩展事件有一个不同的值,称为“sqlserver.client_connection_id”,它与“sys.dm_exec_requests”表中的“connection_id”不同。

你知道我在哪里可以找到系统表中的“sqlserver.client_connection_id”吗?或其他解决方案来唯一地识别已执行的查询?

0 投票
1 回答
241 浏览

sql - 如何在 sys.dm_* 中选择数据库名称

我正在通过服务调用存储过程。我希望我的存储过程在数据库上运行。我有两个问题

  1. sys.dm_* 表是特定于数据库的还是通用的?

上述查询是返回所有数据库的请求还是正在执行查询的当前数据库?

  1. 如果 sys.dm_* 特定于数据库,有没有办法通过存储过程指定数据库。我知道我们不能使用use. 并且select * FROM [dbname].sys.dm_exec_requests似乎不起作用。它返回当前数据库的结果。我在这里可能错了。
0 投票
0 回答
62 浏览

database-migration - 相当于 POSTGRESQL 中 SQL Server 的 SYSPROCESS

我在 SQL Server 中有一个查询:

我想知道这个在 POSTGRESQL 中的等效代码。

谢谢!

0 投票
1 回答
488 浏览

sql - 如何将系统表或信息架构表与 Redshift 中的用户定义表连接起来

我有一个要求,我需要将 RedshiftInformation schema表与User defined表连接起来。我尝试了以下查询并得到了提到的错误。

SQL Error [500310] [0A000]: [Amazon](500310) Invalid operation: Specified types or functions (one per INFO message) not supported on Redshift tables.;

SQL Error [500310] [0A000]: [Amazon](500310) Invalid operation: Specified types or functions (one per INFO message) not supported on Redshift tables.;

可能是我缺少一些基础知识,请建议。