SQL statement query table name/column name/primary key/Auto grow value in database
----A table created by a user in a query database
----JSJ01 as database name
Select name tablename
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 =
Tags: mysql dynamic SQL statement execution modification table name Timesheet name1. DescriptionWhen it comes to using data, we need a lot of databases, and we want to use time to make table names to differentiate. However, MySQL does not support the use of variable names for table
MySQL dynamic SQL statement execution uses time as the table name, mysqlsql1. Description
When using data, we need a lot of databases and want to use time as the table name to differentiate them. However, MySQL does not support using variable names as
Sp_rename N 'table name. Field name', 'new field name', 'column 'top
Sp_renameChange the name of the user-created object (such as a table, column, or user-defined data type) in the current database.SyntaxSp_rename [@ objname =] 'o
1. Descriptive narrativeWhen it comes to using data, we need a lot of databases and we want to use time to make table names to differentiate. However, MySQL does not support the use of variable names for table names or column names in stored procedures.For example, there is a table we want to name "2015-07-16 12:00:00"
I did not pay too much attention to the table name when designing the database. I designed a user, order, and modify table. I think there is no problem, you can find a problem only when using exported SQL to generate a database.
These table names are highlighted, and they
I. What is covered in this article (Contents)
What is covered in this article (Contents)
Background (contexts)
Implementation code (SQL Codes)
Method One: Use splicing SQL, static column field;
Method two: Using splicing sql, dynamic column field;
Method Three: Use pivot relational operator, static column field;
Metho
I. What is covered in this article (Contents)
What is covered in this article (Contents)
Background (contexts)
Implementation code (SQL Codes)
Method One: Use splicing SQL, static column field;
Method two: Using splicing sql, dynamic column field;
Method Three: Use pivot relational operator, static column field;
Metho
Match the table name in an SQL statement. The Python regular expression is used for matching. I wanted to build a tool similar to PLSQL, which is not complete yet. Record it first.
#-*-Coding: UTF-8-*-import rekeylist = ['access', 'add', 'all', 'alter ', 'and', 'any ', 'as', 'asc', 'audit', 'between', 'by', 'Char ', 'check', 'cluster', 'column', 'comment ', 'com
Label: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 different, as follows: SQL Server database: system table: ---Get in
During SQL use, when we delete a database table, we need to judge the existence of the table, and then delete the operation. Here's a look at how to use SQL to determine whether a table exists:
The SQL code is as follows:
SQL Server dynamic query (table name or field dynamic), and get the desired return value result (Exec sp_execute
Key words:
In the preparation of SQL statements or stored procedures, it is inevitable that the table
Can rename table but can not truncate table, renametruncateA table cannot be truncate but can be rename. This sounds strange at first. The process is simulated below.Three sessions:Session1 performs the truncate and rename operati
Label:CREATE TABLE Test(Department varchar (10),Customer varchar (10),Cost name varchar (10),Amount int)INSERT into test values (' A ', ' a ', ' phone fee ', 10)INSERT into test values (' A ', ' a ', ' run at public expense ', 11)INSERT into test values (' A ', ' a ', ' Bus fee ', 9)INSERT into test values (' A ', ' B ', ' phone fee ', 10)INSERT into test values (' A ', ' B ', ' public expense ', 10)INSERT
View table:exec sp_help table name Look up columns: exec sp_columns table name View column:Select * from information_schema.columns where table_name = ' table name '
Add column:ALTER
Oracle renaming tables and operations on copying table information Java code oracle modifying table name alter table_name rename to new_table_name; www.2cto.com oracle Inserting Data Based on queries Insert is a common statement in T-SQL, insert INTO
the object_name () method is reserved;Next we see in the previous Sys.extended_properties table major_id This field, what does this field mean? So I got a look at the contents of sys.columns.object_id=sys.extended_properties.major_id from sys.columns, such as the aboveSelect * from where object_id = 613577224The result is exactly the field information in the same table, and concludes:major_id and sys.colu
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.