Questions tagged [system-tables]

59 questions
0
votes
0 answers

SQL Server 2019 - suspicious values in sys.sm_exec_sessions.last_request_end_time

We continuously gather data from sys.sm_exec_sessions and sys.dm_exec_requests to be able further investigate our locking and performance issues. In some cases, I can see that multiple queries to sys.sm_exec_sessions returns the same value of…
0
votes
1 answer

Netezza to Redshift Conversion - _v_table and _v_relation_columns alternatives

What are the alternatives for the below Netezza Tables and columns that I could use in Redshift? _v_table (columns used: 'RELVERSION' and 'OBJTYPE') _v_relation_columns (columns used: 'NAME' and 'ATTNAME')
0
votes
0 answers

How can I replace master..sp_values (used for months) on this query?

I'm using master..spt_values within a SQL Server that support is, using it as "months" numbers support (don't ask me why; probably old query write on-the-fly): SELECT months.number as Month, ISNULL(t2.NumVisits, 0) AS NumVisits, …
markzzz
  • 47,390
  • 120
  • 299
  • 507
0
votes
2 answers

how to add new column in pg_class for object creation date dumping

I want to create a column in pg_class for object creation dumping but I am not able to add. I am using below query: ALTER TABLE pg_catalog.pg_class ADD COLUMN relcreated TIMESTAMP; when I run this query I'm getting below error: ERROR: permission…
0
votes
1 answer

SQL Anywhere query to dig schema structure

I'm trying to make a SQL query which does the following things: Select all tables in a schema Select all columns from the table Select the columns type (char, int, tinyint, etc) Select the columns index type or NULL (index type being FK or PK) If…
Tim
  • 358
  • 2
  • 7
0
votes
1 answer

How to join System tables or Information Schema tables with User defined tables in Redshift

I have a requirement where I need to join Redshift Information schema table with User defined table. I have tried below queries and getting mentioned errors. select * from pg_table_def a join user_defined_table b on 1 = 1 -- condition just to give…
Tajinder
  • 2,248
  • 4
  • 33
  • 54
0
votes
0 answers

Equivalent of SQL Server's SYSPROCESS in POSTGRESQL

I have a query in SQL Server: SELECT kpid,hostprocess FROM master..sysprocesses I want to know the equivalent code of this in POSTGRESQL. Thanks!
dn2301
  • 5
  • 4
0
votes
1 answer

How to select database name in sys.dm_*

I'm calling stored proc through a service. I wanted my stored proc to be running on a database. I've two questions Is sys.dm_* tables specific to a database or it is general one? select * FROM sys.dm_exec_requests Does above query return requests…
SQLProfiler
  • 109
  • 7
0
votes
2 answers

Extended Events connection_id vs client_connection_id

Hello guys I want to find a way to identify a query executed for Extended Events in Microsoft SQL Server (to filter the Extended Event with only that executed query) If i query the system views in SQL Server like this: SELECT session_id,…
user8554358
0
votes
2 answers

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…
Ed Avis
  • 1,350
  • 17
  • 36
0
votes
1 answer

Teradata - How to get number acces by table and by month

I am tring to get an user number per table and per month. I am trying to get read access (select and no update delete) Do you know if it is possible to get this with view like dbc.tables ? Database | Table | Date (YYYYMM) | Number of…
Maxime
  • 1
  • 3
0
votes
1 answer

How to copy data from Netezza DEFINITION_SCHEMA [ignoring the bytea error]

I am trying to analyse the code used in the stored procs on our Netezza server. First step is to get the definitions/code contained in the stored procs - this can easily be done by either of the following: Using the system views select …
Cor Basson
  • 43
  • 1
  • 5
0
votes
0 answers

how to find the exact system table name to disable recaptcha module in Drupal? help needed

how to find the exact system table name to disable recaptcha module in Drupal? my Drupal version is 8.5.5 I have followed the Drupal official doc and run command: UPDATE system SET status = 0 WHERE name = "recaptcha"; but Seeing an error “ERROR…
andy
  • 1
0
votes
2 answers

SQL Server system table identity crysis / SYSOBJECTS table ID is close to int max value

SYSOBJECTS table has an identity column of int type. But values in ID column are getting close to int max value. I guess it'll become impossible to create any objects when it reaches its maximum. Is there a way to alter that table to convert ID…
SergB
  • 91
  • 7
0
votes
0 answers

Script of "INFORMATION_SCHEMA.TABLES"

I am looking for the create script of the System View named "INFORMATION_SCHEMA.Tables" in SQL Server. I hope it will help me to drill down the internal table structure of SQL Server and to identify how the SQL Server to store its internal data.