Questions tagged [system-views]
34 questions
9
votes
2 answers
How to determine if a column of a view is derived or constant?
Let's say I have the following table:
create table t_Item (
ItemID int not null identity(1,1) constraint PK_Item primary key,
Description varchar(256) not null,
Price decimal(10,2) not null
)
and the following view:
create view Item as
…

madprog
- 275
- 1
- 4
- 13
4
votes
3 answers
Find package global variables from data dictionary
I have a package:
CREATE PACKAGE my_pkg
IS
g_var NUMBER;
END;
/
Is there any way I can query SYS views, to find that this package has this global variable? I'm interested in explicit variable name and data type.
P.S.
Parsing user_source does not…

jva
- 2,797
- 1
- 26
- 41
3
votes
1 answer
View_Definition in INFORMATION_SCHEMA.VIEWS is limited to 4000 characters
I'm backing up all of my views by running this query, and storing the results in a table:
select
TABLE_CATALOG as DBName
, TABLE_NAME as ViewName
, VIEW_DEFINITION as ViewDef
, datalength(VIEW_DEFINITION) as [Length]
, GETDATE() as…

user1916006
- 31
- 1
- 4
3
votes
4 answers
Is there a view in SQL Server that lists just primary keys?
I'm working with SQL Server and trying to do a little "reflection," if you will. I've found the system view sys.identity_columns, which contains all of the identity columns for all of my tables.
However, I need to be able to select information about…

benjy
- 4,664
- 7
- 38
- 43
2
votes
2 answers
What is pg_class in Postgres and how to see it using pgAdmin 4?
I'm new to Postgresql and I just saw my friends query on a cakePhp controller that call 'pq_class'. I tried to look up to my PostgreSQL database and find out what's inside using pgAgmin4.
Unfortunately, I can't see any table name with 'pg_class'. I…

Maryadi Poipo
- 1,418
- 8
- 31
- 54
2
votes
1 answer
How does SQL Server detmine the next value in a sequence?
If you alter a sequence to restart with a value exactly the same as its current value the next value will be the one specified as opposed to the current value plus the increment. All very well and good but how does the SQL Server engine determine to…

StuKay
- 307
- 1
- 7
2
votes
1 answer
SQL sys.dm_exec_query_stats Last_Elapsed_Time nonsense
I am working on a script I can deploy to any SQL server that will give some meaningful statistical information on the servers usage. I quite quickly realized though that I was getting some rather suspect results back from the last_elapsed_time…

CJH
- 1,266
- 2
- 27
- 61
2
votes
0 answers
How can I see the layout structure of Status-bar, Navigation bar and System keyboard in Android?
I am using Dump View Hierarchy for UI Automator to see the layout structure for Android app. (Dump View Hierarchy for UI Automator image below)
You can see this option by selecting the DDMS.
But this tool is not showing the layout structre of…

Akashsingla19
- 690
- 2
- 8
- 18
2
votes
2 answers
System views in MySQL
I'm using system catalog views such as SYS.ALL_ OBJECTS, SYS.FOREIGN_KEYS etc. to get information about my database structure in MS SQL 2005.
Are there equivalent functions/views for MySQL (v. 5) servers?

Tom Juergens
- 4,492
- 3
- 35
- 32
2
votes
3 answers
Select all UDFs from database?
Something like:
SELECT * FROM sys.functions

Shimmy Weitzhandler
- 101,809
- 122
- 424
- 632
1
vote
1 answer
Is is possible to find an equivalent Login in a 2nd database via a single query?
A database-level Login can be associated with zero to one server-instance-level Logins. And if it exists, that in turn can be associated with zero to one database-level Logins on another database.
Is it possible to retrieve the matching Login using…

dlh
- 549
- 4
- 7
- 20
1
vote
0 answers
Finding columns used in a calculation in a SQL Server view
I'm trying to put a data dictionary together for a client using SQL Server MDS. In order to avoid tracking the specific location in the data warehouse/marts/source systems of the fields being defined, I'm hoping to use the system views as much as…

El Kabong
- 23
- 4
1
vote
2 answers
List all foreign keys PostgreSQL
I need a query that returns:
"table_name", "field_name", "field_type", "contraint_name"
until now i have:
select conrelid::regclass AS table_name,
regexp_replace(pg_get_constraintdef(c.oid), '.*\((.*)\)', '\1') as fields,
conname as…

tavogus
- 35
- 1
- 7
1
vote
1 answer
SQL Server INFORMATION_SCHEMA.VIEW_COLUMN_USAGE not updated on table update
I'm trying to learn more about SQL Server, and I came across something I don't understand. I have a SQL Server 2008 database (the free version). I have a view that I defined using a wildcard, like this:
Select * from ApplicantApplications
When I…

user1304444
- 1,713
- 3
- 21
- 38
0
votes
1 answer
VIEW SERVER STATE permission was denied on object 'server', database 'master'
I am querying my database from an application and the following syntax is executable
SELECT t.name AS TableName
,i.name AS indexName
,sum(p.rows) AS RowCounts
,sum(a.total_pages) AS TotalPages
,sum(a.used_pages) AS UsedPages
…

David Garcia
- 3,056
- 18
- 55
- 90