473,385 Members | 1,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

database table / column metadata

I'm building a medium-scale data-entry web application, which involves
creating data entry forms, record listings and detail screens for lots of
database tables.

Rather than designing a series of similar web pages for each table I'm
looking into recording metadata about tables / columns in the database and
using this to determine presentation.

Let's keep things simple for now and assume that I'm interested in adding
more user friendly captions to replace actual column names, e.g. 'Unit
Price' instead of 'unit_price' and would also like column descriptions to be
easily available. If this data were held in the database, then captions and
descriptions could be looked up dynamically within the application. This
would be better than defining captions individually within a .Net DataGrid
or HTML template. It would also allow metadata to be shared between
applications.

A brief search around dev sites hasn't revealed anything. Are there any
recommended ways of doing this?

This actually looks pretty easy, the data could be held in 2 tables:

TABLE: table_metadata:
- table_id
- db_table_name (name of table in database)
- caption (user friendly title for table)
- description

TABLE: column_metadata
- id
- table_id
- db_column_name (name of table in database)
- caption (user friendly column title)
- description

Thanks in advance

Dan

Nov 18 '05 #1
3 2732
Of course you could roll your own...

You should also review this in BOL:

Property Management
Microsoft® SQL Server™ 2000 introduces extended properties that users can
define on various objects in a database. These extended properties can be
used to store application-specific or site-specific information about the
database objects. Because the property is stored in the database, all
applications reading the property can evaluate the object in the same way.
This helps enforce consistency in how data is treated by all of the programs
in the system.

Each extended property has a user-defined name and value. The value of an
extended property is a sql_variant that can contain up to 7500 bytes of
data. Individual database objects can have multiple extended properties.

Extended properties are managed using three system stored procedures:
sp_addextendedproperty, sp_updateextendedproperty, and
sp_dropextendedproperty. You can read the value of an existing extended
property using the system function FN_LISTEXTENDEDPROPERTY.

There is no convention or standard for defining extended properties. The
database designer sets the rules specifying the property names and contents
when the database is designed, and then the applications accessing the
database have to be coded to follow those rules or conventions.
See Also

Using Extended Properties on Database Objects

fn_listextendedproperty

sp_addextendedproperty

sp_dropextendedproperty

sp_updateextendedproperty

©1988-2000 Microsoft Corporation. All Rights Reserved.
a quick google on those procs and functions will show you a number of people
who have built reasonably helpful sample apps for managing these properties.
--

Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Daniel M" <da************@becta.org.uk> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I'm building a medium-scale data-entry web application, which involves
creating data entry forms, record listings and detail screens for lots of
database tables.

Rather than designing a series of similar web pages for each table I'm
looking into recording metadata about tables / columns in the database and
using this to determine presentation.

Let's keep things simple for now and assume that I'm interested in adding
more user friendly captions to replace actual column names, e.g. 'Unit
Price' instead of 'unit_price' and would also like column descriptions to be easily available. If this data were held in the database, then captions and descriptions could be looked up dynamically within the application. This
would be better than defining captions individually within a .Net DataGrid
or HTML template. It would also allow metadata to be shared between
applications.

A brief search around dev sites hasn't revealed anything. Are there any
recommended ways of doing this?

This actually looks pretty easy, the data could be held in 2 tables:

TABLE: table_metadata:
- table_id
- db_table_name (name of table in database)
- caption (user friendly title for table)
- description

TABLE: column_metadata
- id
- table_id
- db_column_name (name of table in database)
- caption (user friendly column title)
- description

Thanks in advance

Dan

Nov 18 '05 #2
Think I've answered my own question ...

It looks like the best way to centralise table and column metadata across a
system would be to use SQL Server's built-in extended properties. This seems
to be an MS recommended way for storing metadata such as captions, input
masks etc:

http://msdn.microsoft.com/msdnmag/is...0/default.aspx

I'm planning to create queries that extract this data from extended
properties and export periodically to tables / XML file for quicker lookup.

Any other comments welcome.
"Daniel M" <da************@becta.org.uk> wrote in message
news:#D**************@TK2MSFTNGP11.phx.gbl...
I'm building a medium-scale data-entry web application, which involves
creating data entry forms, record listings and detail screens for lots of
database tables.

Rather than designing a series of similar web pages for each table I'm
looking into recording metadata about tables / columns in the database and
using this to determine presentation.

Let's keep things simple for now and assume that I'm interested in adding
more user friendly captions to replace actual column names, e.g. 'Unit
Price' instead of 'unit_price' and would also like column descriptions to be easily available. If this data were held in the database, then captions and descriptions could be looked up dynamically within the application. This
would be better than defining captions individually within a .Net DataGrid
or HTML template. It would also allow metadata to be shared between
applications.

A brief search around dev sites hasn't revealed anything. Are there any
recommended ways of doing this?

This actually looks pretty easy, the data could be held in 2 tables:

TABLE: table_metadata:
- table_id
- db_table_name (name of table in database)
- caption (user friendly title for table)
- description

TABLE: column_metadata
- id
- table_id
- db_column_name (name of table in database)
- caption (user friendly column title)
- description

Thanks in advance

Dan

Nov 18 '05 #3
Thanks Brian

As you'll see from my next post, I came to a similar conclusion.

"Brian Moran" <br***@solidqualitylearning.com> wrote in message
news:ug**************@TK2MSFTNGP09.phx.gbl...
Of course you could roll your own...

You should also review this in BOL:

Property Management
Microsoft® SQL ServerT 2000 introduces extended properties that users can
define on various objects in a database. These extended properties can be
used to store application-specific or site-specific information about the
database objects. Because the property is stored in the database, all
applications reading the property can evaluate the object in the same way.
This helps enforce consistency in how data is treated by all of the programs in the system.

Each extended property has a user-defined name and value. The value of an
extended property is a sql_variant that can contain up to 7500 bytes of
data. Individual database objects can have multiple extended properties.

Extended properties are managed using three system stored procedures:
sp_addextendedproperty, sp_updateextendedproperty, and
sp_dropextendedproperty. You can read the value of an existing extended
property using the system function FN_LISTEXTENDEDPROPERTY.

There is no convention or standard for defining extended properties. The
database designer sets the rules specifying the property names and contents when the database is designed, and then the applications accessing the
database have to be coded to follow those rules or conventions.
See Also

Using Extended Properties on Database Objects

fn_listextendedproperty

sp_addextendedproperty

sp_dropextendedproperty

sp_updateextendedproperty

©1988-2000 Microsoft Corporation. All Rights Reserved.
a quick google on those procs and functions will show you a number of people who have built reasonably helpful sample apps for managing these properties.

--

Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Daniel M" <da************@becta.org.uk> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I'm building a medium-scale data-entry web application, which involves
creating data entry forms, record listings and detail screens for lots of database tables.

Rather than designing a series of similar web pages for each table I'm
looking into recording metadata about tables / columns in the database and using this to determine presentation.

Let's keep things simple for now and assume that I'm interested in adding more user friendly captions to replace actual column names, e.g. 'Unit
Price' instead of 'unit_price' and would also like column descriptions to
be
easily available. If this data were held in the database, then captions

and
descriptions could be looked up dynamically within the application. This
would be better than defining captions individually within a .Net

DataGrid or HTML template. It would also allow metadata to be shared between
applications.

A brief search around dev sites hasn't revealed anything. Are there any
recommended ways of doing this?

This actually looks pretty easy, the data could be held in 2 tables:

TABLE: table_metadata:
- table_id
- db_table_name (name of table in database)
- caption (user friendly title for table)
- description

TABLE: column_metadata
- id
- table_id
- db_column_name (name of table in database)
- caption (user friendly column title)
- description

Thanks in advance

Dan


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Daniel M | last post by:
I'm building a medium-scale data-entry web application, which involves creating data entry forms, record listings and detail screens for lots of database tables. Rather than designing a series...
1
by: RSH | last post by:
Im trying to write a simple app that will show all of the user created tables along with their columns and column datatypes. Any suggestions on how to approach this??? Thanks!
0
by: RSH | last post by:
I am writing an app to extract Access database schemas. The issue is that while I have everything working, I am having trouble decyphering the returned values with regards to the column values. ...
1
by: Dan Manes | last post by:
Wondering what other people do about this issue... You're writing a web app in asp.net that requires user input. Data will be stored in SQL Server Express database. You want to make sure data...
3
by: Peter Kirk | last post by:
Hi I am reading metadata from a database (sql server) - for example metadata describing columns in a table. This metadata includes information about the datatype of the column - for example...
2
by: sloan | last post by:
Back in ADO days, it was fairly easy to get the meta data (tablenames, columnnames , etc) .. with all that schema stuff. I have a Access database, that I'd like to get the list of tableNames in...
10
by: shsandeep | last post by:
The ETL application loaded around 3000 rows in 14 seconds in a Development database while it took 2 hours to load in a UAT database. UAT db is partitioned. Dev db is not partitioned. the...
2
by: dvawdrey | last post by:
Can someone help me please with the following code: try { DatabaseMetaData metadata=con.getMetaData(); System.out.println(metadata.getDriverName()); System.out.println("Driver version:...
5
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.