Automatically generate database dictionary

Source: Internet
Author: User

1. First, you must enter the description of each column in the table.

2. Create an attempt

 
Go/***** object: view [DBO]. [sura_view_dbdictionary] script Date: 05/31/2013 17:19:19 ******/set ansi_nulls ongoset quoted_identifier ongocreate view [DBO]. [sura_view_dbdictionary] As/*** Cao feilong creates a database dictionary * test_db is the database name **/select C. name as tablename,. name as colname, D. data_type as type, B. valuefrom sys. syscolumns as a left Outer Join sys. extended_properties as B on. colid = B. minor_id and. id = B. major_id left Outer Join sys. sysobjects as C on C. id =. id left Outer Join information_schema.columns as D on D. table_name = C. name and D. column_name =. namewhere (D. table_catalog = 'test _ db') Go

3. query Attempt

 
Select * From sura_view_dbdictionary where tablename = 'sura _ storange'

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.