Discover select column names from table, include the articles, news, trends, analysis and practical advice about select column names from table on alibabacloud.com
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Alter
Table
Name
Alter
Table
-Change table attributesSyntax
Alter
Table
Table
[
*
]
Add
[
Table column name is more time, manual write column name is more troublesome, this function can let a person secretly lazyCreate or Replace function F_getcols (p_tablename in varchar2/* gets all column names in the table before and after you add
CREATE TABLE as SELECT * FROM and insert to select from two table copy statement differences[SQL]View PlainCopy
Create table targer_table as select * from source_table
INSERT INTO target_table (column1,column2) select Column1,column2
Gets the primary key column name of the table SQLSELECT * FROM User_cons_columnswhere constraint_name = (select Constraint_name from user_constraintsWHERE table_name = ' bst_favorite ' and constraint_type = ' P ');Remember : table names are
SQL Server obtains all column names in the temporary table or whether the specified column name exists. SQL Server column names
Retrieve all column names in the temporary table
Select name from tempdb. dbo. syscolumns where id = object_id ('#
1. Get allDatabase Name: (1) Select name from Master. DBO. sysdatabases order by name2. Get all table names:(1) Select name from sysobjects where xtype = 'U' order by nameXtype = 'U': indicates all user tables;Xtype = 's': indicates all system
Often encountered some forget the table name situation, at this time only remember a approximate, at this time can be queried by the system table sysobjects to find the table name, such as to find the name of the table containing the user, can be
Citation: Http://www.2cto.com/database/201209/155178.htmlSQL statement gets all database names, table names, field names, table fields length gets all the tables in the database select Sysobjects.name as Tablename from sysobjects WHERE xtype = ' U '
Obtain the table's primary key column name SQLSelect * From user_cons_columns
Where constraint_name = (select constraint_name from user_constraints
Where table_name = 'bst _ favorite 'and constraint_type = 'P ');
Remember: The table name must be in
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.