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 ('#
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
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 '
SQL obtains all user names, database names, all table names, all field names, and field types. 2009 - 03 - 14 10 : 48 1 . Get all user names: Select Name From Sysusers Where Status = ' 2 ' And Islogin = ' 1 ' Islogin = ' 1 '
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
By using SQL, you can specify aliases (alias) for column names and table names.SQL alias syntax for SQL alias tableSELECT column_name (s) from Table_nameas Alias_nameSQL Alias syntax for columnsSELECT column_name as Alias_namefrom table_name
Alias
SQL queries all database names, table names, stored procedures, and parameter lists
1. Get all user names: Select name from sysusers where status = '2' and islogin = '1' Islogin = '1' indicates the account
SQL statement that queries all table field properties in a database 1. Get all user names: SELECT name from Sysusers where status= ' 2 ' and islogin= ' 1 ' islogin= ' 1 ' represent account islogin= ' 0 ' table The role status= ' 2 ' indicates that
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.