In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
SQL Server Table dictionary data query SQL sample code how to write, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
Preface
The database contains four types of data:
1. User data
two。 Meta data
3. Indexes
4. Apply metadata
Among them, metadata is also called data dictionary and is defined as follows:
The following article is going to share with you a SQL statement about querying the SQL Server Table structure.
T-SQL is as follows:
SELECT (case when a.colorder=1 then d.name else''end) table name, a.colorder field serial number, a.name field name, (case when a.colorder=1 then isnull (f. Valuememe') else''end) table description, (case when COLUMNPROPERTY (a.iddepartment a.namememery) = 1 then' 1'else'0' end) identification (case when (SELECT count (*) FROM sysobjectsWHERE (name in (SELECT name FROM sysindexesWHERE (id = a.id) AND (indid in (SELECT indid FROM sysindexkeysWHERE (id = a.id) AND (colid in (SELECT colid FROM syscolumns WHERE (id = a.id) AND (name = a.name) AND (xtype = 'PK')) primary key, b.name type, a.length occupies bytes, COLUMNPROPERTY (a.idmatia. Namee Last PRECISN') as length Isnull (COLUMNPROPERTY (a. 1'else a. Name), 0) as decimal places, (case whena.isnullable=1 then '1'else' 0' end) allows null, isnull (e.textpaper') default value, isnull (g. [value] '') AS [description] FROM syscolumns aleft join systypes b on a.xtype=b.xusertypeinner join sysobjects d on a.id=d.id and d.xtypewritten tables U' and d.name'dtproperties'left join syscomments e on a.cdefault=e.idleft join sys.extended_properties g on a.id=g.major_id AND a.colid=g.minor_idleft join sys.extended_properties f on d.id=f.major_id and f.minor_id=0--where b.name is not nullWHERE d.nameplates database servers'- if only the specified table is queried Add this condition After reading the above, have you mastered how to write the query SQL sample code for Table dictionary data in SQL Server? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.