Here are a few of my statistical options:
first Scenario (recursive):
The simple table structure is:
CategoryID Int (4),
CategoryName nvarchar (50),
ParentID Int (4),
Depth Int (4)
In this way, according to the parentid level of the use of
SQL statement Query
The table structure is like this:
ID name Sex
1 Three men
2 Wang Shinan
3 Lili Girl
4 Three Men
5 Chao Liuan
6 Noble Male
7 Wang Shiju
8 Noble Women
9 Three Girls
How can I query the following results with an SQL statement
Test environment
Hardware: CPU core dual-core T5750 Memory: 2G
Software: Windows Server 2003 + SQL Server 2005
OK, we first create a database: Data_test, and create a table in this database: tb_testtable
Copy CodeThe code is as follows:
Create
Although there are many previous articles that discuss SQL injection, the content discussed today may help you check your server and take precautions. TSE, you can win. The first thing to understand is what kind of SQL injection attack is.
Looking
Aggregate statements (Sum,min,max,avg,count) are executed more than the HAVING clause in the query process. The WHERE clause takes precedence over the aggregate statement (SUM,MIN,MAX,AVG,COUNT) in the query process.
The HAVING clause is similar
SQL random query statements, [database Use techniques]sql statements generate random numbers, how to randomly display SQL query statement query data recordset 20, randomly fetch several records of SQL statements, using SQL statements to take random
Several suggestions for improving SQL execution efficiency:
Try not to include subqueries in the Where;
About the time of the query, try not to write: where To_char (dif_date, ' Yyyy-mm-dd ') =to_char (' 2007-07-01 ', ' yyyy-mm-dd ');
In the
1. View the version of the database
SELECT @ @version
2. View the machine operating system parameters of the database
EXEC master.. xp_msver
3. View Database Startup Parameters
sp_configure
4. View Database Startup time
Select CONVERT
Want to understand the process and principle of SQL injection, online find some articles, speak are relatively superficial, but I know there are several domestic more commonly used injection tools, such as Domain3.5, NBSI3.0, ah D2.32, and pangolin,
/*SQLGetting Started with XML:--by Jinjazz--http://blog.csdn.net/jinjazz1. xml: Ability to recognize elements, attributes, and values2. XPath: addressing language, lookup similar to Windows directory (go to the wall if you don't use the dir
For non-banks and other stringent requirements of the business, if a record appears or does not appear in the search record, it is within tolerable bounds, so the deadlock should first be considered as to whether our business logic tolerates or does
Execute the following code in SQL Query Analyzer.
01.declare @t varchar (255), @c varchar (255)02.declare table_cursor cursor FOR select A.name,b.name03.from sysobjects a,syscolumns b, systypes c04.where a.id=b.id and a.xtype= ' U ' and
In my new function of using SQL Server2005 to construct a paging stored procedure, I mentioned using the Row_number () function instead of top to implement the paging stored procedure.
But the time is long, and found a new problem, is the master
Some people put forward the cursor is not good, will lock the row, luckily I locked is the temporary table, is not the data table, does not affect the data table's write operation.
Here is the 14 floor of the reply, let me enlightened, so with
Server.scrīpttimeout, the default value is 90 seconds.
To enlarge it, add a sentence to your ASP file, as follows:
server.scrīpttimeout=999,
Set the page timeout to 999 seconds.
Initially I only set server.scrīpttimeout,
However, there will still
Data | database | Log |mssql| compression
The database in the cumulative operation process, not only its own volume will slowly grow, its log capacity size as well as the database entity file growth and will occupy a lot of space. the size of the
In a network set up with the TCP/IP protocol family, each node has a unique IP address that is used as their only token. However, it would be unthinkable if the user were to be remembered for such an IP address without a memory rule. People need a
What exactly is a mail server? The mail server provides the basic structure of the messaging system, including the ability to mail transfer, mail distribution, and mail storage to ensure that messages can be sent anywhere on your Internet
In the actual application process may encounter the problem of DNS parsing errors, that is, when we access a domain name can not be completed to resolve the work of the IP address, and the direct input of the Web site IP can be normal access, this
Windows server's own Internet Information Server (Internet Information Server,iis) is a common tool for building Web servers, a simple and cumbersome thing, and novice users can use IIS to erect a respectable web site, But configuring, optimizing
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service