Data that describes other data or data structures.

learn more… | top users | synonyms

27
votes
4answers
75k views

How do I list or search all the column names in my database?

I want to search for a string in the names of the columns present in a database. I’m working on a maintenance project and some of the databases I deal with have more than 150 tables, so I'm looking ...
20
votes
4answers
1k views

What's up with the collation of some columns in sys.databases?

I'm attempting to run an UNPIVOT on various columns contained in sys.databases across various versions of SQL Server, ranging from 2005 to 2012. The UNPIVOT is failing with the following error ...
15
votes
5answers
6k views

Best way to store units in database

I have inherited a large (SQLServer) database with hundreds of columns that represent amounts of one thing or another. The units for these values (e.g. "gallons", "inches", etc) are stored in the ...
14
votes
1answer
8k views

How can I force SQL Server Management Studio to update metadata?

Metadata in SSMS isn't updating unless I shut it down and restart. I've tried disconnecting from the server and reconnecting while the SSMS session is active, but that isn't working. Steps to ...
13
votes
4answers
51k views

Copy complete structure of a table

Using some methods, when you create a copy of a table you lose indexes, PK, FK, etc. For example in SQL Server I can say: select * into dbo.table2 from dbo.table1; This is just a simple copy of the ...
11
votes
3answers
49k views

How do I get a list of all the partitioned tables in my database?

How do I get a list of all the partitioned tables in my database? Which system tables/DMVs should I be looking at?
10
votes
2answers
443 views

SUM of DATALENGTHs not matching table size from sys.allocation_units

I was under the impression that if I were to sum the DATALENGTH() of all fields for all records in a table that I would get the total size of the table. Am I mistaken? SELECT SUM(DATALENGTH(Field1)) ...
10
votes
2answers
126 views

Does there exist a way to determine the exact file that contains an allocation unit in a filegroup of multiple files?

I was hoping to get a granular view of which database files contained which allocation units for the various HoBTs (both aligned and non-aligned) living in a database. The query I've always used (see ...
9
votes
2answers
648 views

SQL Server Filetable document properties

I'm using SQL Server 2012's Filetable to store documents and search them with Semantic Search. I was wondering if there is a way to list all the document properties (meta data). There is a way to ...
8
votes
1answer
2k views

Best practice for storing record metadata

What is the best practice for storing metadata of individual records in a database? I need to store common meta data such as creation time and time of last update for many tables in my database. I ...
8
votes
3answers
4k views

Is there an Open Source Metadata Management Solution? [closed]

Is there an Open Source Metadata Management Solution? I'd like to create a Metadata Repository that will hold the details of the metadata of database schemas, tables and data items of hundreds of ...
6
votes
4answers
2k views

How to document Oracle database?

I'm new to Oracle databases. I have used to SQL Server and the description fields (MS_Description) for tables and columns for documentation purposes. Is there an equivalent for Oracle? What is the ...
6
votes
2answers
269 views

Add [Is Primary Key Column] to this query

I made this query, to list tables, its columns, data type and etc: select t.name as 'Table', c.name 'Column', ty.name 'Data_Type', c.max_length as 'Max_Lenght', c....
6
votes
1answer
2k views

What's the difference between a v$ view and its dba_ equivalent?

What's the general difference between a v$ view and its dba_ equivalent? Take, for example, v$tablespace and dba_tablespaces.
6
votes
2answers
191 views

sys.dm_sql_referenced_entities fails to provide used columns list when joining with temp table

I think I need some help as I run out of ideas. In my database I have a simple table like this: CREATE TABLE dbo.Invoices ( CashDiscounts MONEY, Cost MONEY ) GO and a stored ...
6
votes
1answer
243 views

dm_exec_describe_first_result_set_for_object for multiple result sets

Does a procedure exist to return metadata for all result sets in a stored procedure? Something like sys.dm_exec_describe_first_result_set_for_object, but for all result sets? Eventually, I will want ...
5
votes
4answers
57k views

How to write a query to find all tables in a db that have a specific column name

I've got a database with about 100 tables and I need to build a join query to get specific data from two of them. I know one but not the other. Basically I need something like: select <tables>...
5
votes
2answers
3k views

Is Information in sys.dm_db_index_usage_stats reliable

I'm archiving data from an old system that has no documentation. Lucky me... I'd like to find out when the tables were created, last accessed etc. Can I trust that this query will give me the correct ...
5
votes
5answers
8k views

Field types for columns in a MySQL query

Is it possible to get the field type from a MySQL query, in the same way you can get it from a table with the SHOW COLUMNS command? edit: i should clarify that a bit. I am aware that I can get the ...
5
votes
3answers
15k views

Understanding Oracle's ALL_TAB_COLUMNS

I'm new to Oracle and database administration in general. As context, I want to create a Java class that will give me the information I would get using DESC SOME_TABLE. I cannot find any specific ...
5
votes
2answers
4k views

Netezza: What schema contains all the system tables / views?

Is there a schema I can look in or a query that I can run to see all the Netezza system or metadata tables? I know about _v_table, _v_view, _v_relation_column, and _v_groupusers. I know there are ...
4
votes
2answers
3k views

How can I get a list of column names and types from a resultset?

Say I get a resultset back from the following query: select * from sys.database_files; For any given resultset, I want to be able to query the column names and types so I can then create tables to ...
4
votes
2answers
418 views

Searching for a Data Dictionary for SQL or Oracle

I am looking for metadata specifications (data dictionary) for SQL Server and Oracle databases. By metadata map, I mean a definitive description of what objects make up database model and their ...
4
votes
2answers
3k views

Database design for dynamic Meta fields of an entity that shall be queried intensively

I'm designing a database structure for a system at which an entity can have a dynamic set of user-defined meta attributes. The meta fields (e.g.: popularity, conversion etc.) and skill values (int, ...
4
votes
2answers
95 views

Where/how do I save extra data per column?

Next to the actual data I have in a table, I need to save some data about those fields. I'm hesitant to call it metadata, because while it is exactly that, metadata has a specific meaning within ...
4
votes
4answers
28k views

User Password Expiry date is null in user_users?

Is it possible to find my password expiry date without asking the DBA? My user does not have privileges to view the DBA_USERS table. Also, I tried select * from USER_USERS table, but expiry_date is ...
4
votes
1answer
72 views

How to extract the structure out of DB2 (Back up Structure)?

Is there a way in db2 to take a backup of the database structure (Metadata) without actual data? My purpose is to pull structure (tables, views, indexes, triggers, procedures and functions) from an ...
4
votes
1answer
517 views

Find all tables that are related to a view recursively sql server

I have a view-A that is comprised of other views (View-B View-C) and I would like to list all the tables that used by View-A (which would include the tables used in View-B and View-C). When I use ...
3
votes
2answers
220 views

Is EAV an appropriate design for a collection of coexisting metadata-rich “fact estimates” on objects? [closed]

I'm attempting to architect a system that will collect estimates on various quantities (10+) on each of many (300K+) objects, and make decisions from the historical record of these estimates. For ...
3
votes
1answer
779 views

Which is the uniqueness level of object_id?

Which is the uniqueness level of object_id in SQL Server? I mean, is this value unique per database, per instance, per server,... Also, what happens when I restore the database in another server or ...
3
votes
3answers
387 views

PostgreSQL equivalent of SQL Server SQL_VARIANT_PROPERTY

Does PostgreSQL have an equivalent function for determining column metadata? Reference: SQL_VARIANT_PROPERTY pg_typeof() appears to be close, but it does not show the precision and scale. Looking up ...
3
votes
1answer
645 views

How to reuse an update trigger for multiple tables in postgresql?

In the database for a new project, I've started the convention of having each table have a last modified timestamp column. To implement this, I wrote a trigger for each table: CREATE TRIGGER ...
3
votes
1answer
260 views

Metadata Headache

A process that I don't have control over is dropping and re-creating tables in a MySQL database every night. This wouldn't be a problem (I think), if it re-created the tables identically every time. ...
3
votes
1answer
246 views

How to format documentation in MS_Description extendedproperties?

I'm using a 'MS_Description' extended property to document parameters in a stored procedure. This parameter's documentation requires more structure than just plain text. That is I would like to ...
3
votes
0answers
31 views

ObjID in Page Header

I am reading this article: Inside the Storage Engine: Anatomy of a page. I have a database MyDB, and there is a table MyTable in the database. I have the following questions: If I do as follows: (...
3
votes
0answers
47 views

Possible SQLite bug?

I am running into an issue with SQLite that I think might be a bug. When I run the PRAGMA table_info command on a view that uses an aggregate function, the data type always comes up empty. To ...
2
votes
1answer
156 views

PostgreSQL - Who or what is the “PUBLIC” role?

I was looking at information_schema.role_table_grants when I saw public in grantee column, then I've checked at information_schema.enabled_roles but this role_name does not exist. => Who or what is ...
2
votes
1answer
134 views

Is there any reason that metadata should not be a part of my database schema?

By metadata I mean things such as: the owner of an entity permissions associated with an entity the date and time of data entry the surety of entered data the format of a text attribute descriptive ...
2
votes
2answers
269 views

How do I get a list of all the partitioned tables and partitioning details in my Teradata?

How do I get a list of all the partitioned tables in teradata? and How do I get a partitioning columns and details for a table in teradata ?
2
votes
3answers
261 views

Looking for industry standard and/or tool to represent and export RDBMS metadata [closed]

Do you know of an industry standard that is designed to describe the metadata contents of a relational database (or part of it, such as tables, columns, etc.)? Do you know if a tool exists that does ...
2
votes
1answer
60 views

What exactly is metadata? How is metadata different than regular data?

As I understand, metadata is data about data- so I think of analytics; is my simple definition correct? How is metadata different than data? I'm simply asking to broaden my understanding-thanks!
2
votes
1answer
117 views

Is it a best practice to contrast table and dependent view metadata to target which views to refresh?

We have non-indexed views created on vendor tables. When they change table structure or column definitions we run sp_refreshview as needed. What is the viability of a script to contrast the table ...
2
votes
2answers
1k views

How to hide metadata from Postgres users?

I need to provide views-only access to some subset of a database, for use by report-writing tools. It's easy enough to use permissions to prevent access to the data in the underlying tables, but I ...
2
votes
1answer
74 views

Disable auto stats in SQL Server

I have couple questions about auto stats in SQL Server: I know I can use the following statement to check if the database auto stats is disabled, but is there a statement to check if a specific ...
2
votes
1answer
55 views

Is there a query to see which stored procedures are using a specific symmetric key?

Is there a query to see which stored procedures are using a specific symmetric key? Or a built in feature of SQL to see this information. The stored procedures are using: OPEN SYMMETRIC KEY !@#$%^ ...
2
votes
0answers
18 views

Persisting typed variables

Is it possible to associate typed variables with an object, such as a database, table, or row? Suppose I want to store the schema version as a NUMERIC.
2
votes
0answers
906 views

How to do automated archiving for a SQL Server database based on interpretation of database metadata?

I am looking for a solution giving me automated archiving of SQL Server databases based on a smart interpretation of table relationships that is able to archive records from related tables minimizing (...
2
votes
2answers
829 views

What could trigger that a login created from a certificate is not visible in metadata

I am trying to create a login and grant it rights to run and unsafe assembly but the check on server_principals does not return the login when it already exists. The script works perfectly fine on my ...
1
vote
1answer
135 views

Querying sys.master_files over a linked server

Querying sys.master_files through a linked server, I get no results. Why? How do I work around this issue?
1
vote
2answers
98 views

InnoDB row metadata size (minimum row size)

I'm trying to decide whether to normalize a thing further, and need to know what the smallest a row in InnoDB can be (I've got MySQL 5.6). This is not exactly my case, but for simplicity, let's ...