IF object_id (N ' usp_queryalltablefieldcontent ') is not nullbegindrop PROC usp_queryalltablefieldcontentendgocreate PROCEDURE usp_queryalltablefieldcontent (@queryFieldType VARCHAR (max),--type to query @queryContent VA Rchar (max),--the content to query @queryFieldName VARCHAR (max) = "--the field name to query) as begin--CREATE table name from the database query, temporary table for field name CREATE TABLE #T MPQUERYTBL (ID INT IDENTITY (1, 1), Ta
@Entity@Table (name= "T_book")//table name name is not necessarily usefulpublic class Book {@Id//Id of the table@GeneratedValue//Self-increment propertyPrivate Integer ID;@Column (length=100)//string Auto-corresponding stringprivate String name;@Column (LENGTH=50)Private String author;The corresponding table is generated according to the commentsBut I got a bug in the process of generating the tag because I didn't follow the spec.Must be the same as the Startup Class (Xxxxapplication) package na
. nvarchar () double-byte storage. Text: Large space. C. Date data type: Datetime,smalldatetime D. Photo type: Image, generally not used, only the database record location.4. FOREIGN KEY constraintsRight-to-load, from table (foreign key table) to main table (primary key table).The data in the primary table cannot be deleted until the data in the child table is deleted.5. Check constraintsColumn value right--->check constraint--add keyword (email lik
individually designed for a table, such as from educational situation, work experience, work in that job, etc.Outside the topic:Users and roles, roles and menus, roles and site columns are many-to-many relationshipsBackground CMS Management:One-to-one situation, display your ID, user name, last login time and then click on a button to pop up a fill in the details of the information entered into the details of the table, ID is the user's ID;One-to-many or many-to-one on a multiple (association I
uniqueidentifier.The Timestamp is used to represent the sequence of SQL Server activities in a binary projection format. Timestamp data is not related to inserting data or date and time.The Bit is made up of 1 or 0. When representing true or false, on, or off, use the Bit data type. For example, ask if a client request for each visit can be stored in a column of this data type.The uniqueidentifier consists of 16-byte hexadecimal digits that represent a globally unique. GUIDs are useful when the
) VALUES (' Xiao Wang ', ' C # Advanced programming ', 8); INSERT into S (name,book,salednumber) values (' Xiao Li ', ' Java from beginner to proficient ', 7); INSERT into S (name,book,salednumber) VALUES (' Xiao Wang ', ' Java from beginner to proficient ', 9); INSERT into S (name,book,salednumber Values (' Xiao Li ', ' Java from beginner to proficient ', 2); INSERT into S (name,book,salednumber) VALUES (' Xiao Wang ', ' C # Advanced Programming ', 3); INSERT into S (Name,book, Salednumber) VAL
No DECLARE @ sqlnvarchar (300 )? DECLAREUpdateStatsForAllDBsCURSORREAD_ONLYFORselectnamefromsysdatabases? DECLARE @ namenvarchar (255) OPENUpdateStatsForAllDBs? FETCHNEXTFROMUpdateStatsForAllDBs
No DECLARE @ SQL nvarchar (300 )? DECLARE UpdateStatsForAllDBs CURSORREAD_ONLYFOR select name from sysdatabases? DECLARE @ name nvarchar (255) OPEN UpdateStatsForAllDBs? Fetch next from UpdateStatsForAllDBs
Update statistics of all database
1. query all tables in the current database
Copy codeThe Code is as follows:SELECTO. object_id AS TableId,TableName = O. name,TableDesc = O. typeFROM sys. columns CInner join sys. objects OOn c. [object_id] = O. [object_id]And o. type = 'U'And o. is_ms_shipped = 0Inner join sys. types TOn c. user_type_id = T. user_type_idLeft join sys. extended_properties PTBOn ptb. class = 1And ptb. minor_id = 0And c. [obj
A simple php code can easily delete all data tables in the entire database. Is this too dangerous? Let's take a look at the deletion method.
The Code is as follows:
Copy code
$ Hostname = 'localhost ';$ User = 'user ';$ Password = 'Password ';$ Dbname = 'dbname ';$ Connect = mysql_connect ($ hostname, $ user, $ password );Mysql_select_db ($ dbname );$ Result = mysql_query ("show tabl
-- Query Information about all oracle tables, tablespaces, and database connections -- 1. select table_name, num_rows, avg_row_len, num_rows * avg_row_len --, 'delete from' | table_name | ';' from user_tables t order by num_rows * avg_row_len desc; -- 2. query the table space Path ------- select * from dba_data_files twhere t. tablespace_name = 'users'; -- 3. query the table space capacity --------- select
A simple method to update two tables at the same time in the Oracle database.
Previously, I only wrote some simple updaet statements, such as updae table set c1 = 'xxx '.
Today, I encountered A data correction problem. The project background is as follows: Table A has two fields a1 and a2, and an associated table B. There are also two fields, b1 and b2. A2 is associated with b2, and we want to update field
First, let's talk about the background. In the project that was about to be launched recently, we met a customer's requirement: The table name is dynamic and determined based on some values in the database. For example
Requirement
The primary table student has two columns of ID and class.
Then there is an example from the xxxstudentdetail table, where XXX is the class value in the student table, and the value range is not limited.
Program Idea: Use select name from sysobjects where xtype = 'U' to obtain all tables, and then open the table cyclically, according to rs_colums.fields (I ). name: field name. fieldtype (rs_colums.fields (I ). type) to obtain the field type, rs_colums.fields (I ). definedsize 'width
Because rs_colums.fields (I). Type Returns numbers, a fieldtype function is written in the program to convert it to a Chinese type.
Private sub commandementclick ()
Introduction to three statement methods for joint modification of multiple tables in Oracle Database
1. The most efficient
Merge into user_member_info
USING (select min (UP. created) as cre, min (up. shop_no) as shop_no, up. memberid as memberid
From user_platform_relation up,
(Select memberid as mid, min (created) as cre
From user_platform_relation
Group by memberid) um
Where up. created = um. crere and u
Read all tables in a mysql database and mysqltable
Let's first look at the Code:
TABLE_NAME table name
Number of TABLE_ROWS table records
The length of DATA_LENGTH data.
["TABLE_CATALOG"] =>
NULL
["TABLE_SCHEMA"] =>
String (10) "leo_ecshop"
["TABLE_NAME"] =>
String (9) "ecs_goods"
["TABLE_TYPE"] =>
String (10) "base table"
["ENGINE"] =>
String (6) "MyISAM"
["VERSION"] =>
String (2) "10 ″
["ROW_FORMAT"] =>
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.