. Net operations on mssql (backup, restore, get table data, get table field information), mssql Field
# Region database management // // restore and restore the database // // Save path /// public bool DataRestore (string FilePath) {string []
PHP MySQL three ways to get table field names and fields information
The information for the tables used in this example is given first:
Get table field information using DESC
The PHP code is as follows:
Operation Result:
Array ( [Field] =
Get table field:
SELECT * from
user_tab_columns
where table_name= ' user table ' ORDER by
column_name
Get Table Comments:
SELECT * from
user_tab_comments
where table_name= ' user table ' ORDER BY
table_name
Get field Comments:
How do I get table field properties and comments in Sql2008? Select B.[value] From Sys.columns a left join Sys.extended_properties B on a.object_id=b.major_id and A.column_id=b.minor _id INNER JOIN sysobjects C on a.column_id=c.id and a.[name]= '
1. Get the tables in the databaseSelect from where type='U'2. Get table fields (here is the route table)Select from Where ID=object_id('Route')3. Get a description of the fields in the tableSELECT Value from :: Fn_listextendedproperty
MySQL Get table informationmysql> use Test;database changedmysql> Show Table status;+---------------+--------+---------+------------+---- --+----------------+-------------+-----------------+--------------+-----------+----------------+---------------
In the application
The PHP Get table field name is implemented by the Mysql_field_name () function, which has the following syntax format:
String Mysql_field_name (resource $result, int $field _offset)
The Mysql_field_name () function returns the
Get table structure in SQL Server2008 with SQLNew data user, the role is public. Mapped to the database on which the table structure is to be obtained, granting the user's identity on the database as db_ownerRun SQL statements such as the
PHP MySQL How to get table comments
$sql = "Show create table about";
$query =mysql_query ($sql);
How do I write the following to get the table comments?
Thank you.
------Solution--------------------
Field?
The proud frog has the answer
SELECT
I used to design a database of a pair of tables in the database to convert the table to JavaBean, and also a slow to play the efficiency is really low, or the teacher is more intelligent learning.
The database visualizer I used was Navicat Premium,
When writing code generator encountered such a problem, want to set up a database after the field description as comments written into the class file, so we searched the Internet a lot of code a long long way (of course, my code is very long), the
SELECTTableName= object_name(c.object_id), Columnsname=C.name, Description=Ex.value, ColumnType=St.name, Length=C.max_length fromsys.columns C Left JOINsys.extended_properties ex onex.major_id=C.object_id andex.minor_id=c.column_id andEx.name=
Orange + soda = orange soda, ∑ (? д?ノ) Dentetsu good boring!!!Turkey + Grill = roast turkey,? (´?`?) Not bad.Wm_concat () + table field query = (?ω?) What would it be?
The Wm_concat () function, which separates the column values by the ","
All tablesSelect from // tables owned by the current user Select from // Selectfrom// including system tablesNotes for TablesSelect * from // comments for the current user owning the table Select * from // comments for all user tables
get table primary key name in PostgreSQL databaseFirst, to obtain the primary key information for the teacher table, as follows:SelectPg_constraint.conname asPk_name,pg_attribute.attname asColname,pg_type.typname asTypeName fromPg_constraintInner
Data from the database in the work to export, but found that the exported Excel column names are field names (in English), to collect data on how to change the field name to Chinese names, and found that Oracle and SQL Server (SQLSERVER2008R2) is
Js to get table cell informationObtains the content of a cell in a table.Var tid = listFrame. now. rows [1]. cells [2]. innerHTML;ListFrame refers to a window or frame.Now indicates the table id.Rows [I] refers to a row, such as the property:
How do I get table field properties and comments in Sql2008?
Select B.[value] From Sys.columns a left join Sys.extended_properties B on a.object_id=b.major_id
and a.column_id=b.minor_id inner join sysobjects C on a.column_id=c.id
and a.[name]= '
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.