1. Why not use the default page function of the GridView?First, let's talk about why the default paging function of the GridView is not used. The GridView control does not really know how to obtain a new page. It only requests the bound data source
With the development of the information age, more and more information systems are used, and more information is available. As the amount of information increases, data presentation, especially reports, is demanding more and more system presentation
Recently to the page to kill, remember before the change DW ASP pagination method, and later wrote the hand-crafted ASP paging, now enter. NET, of course, with stored procedures to create pure manual high-performance paging.
Why it is called
For example:
Id name value
1 a pp
2 a pp
3 B iii
4 B pp
5 B pp
6 c pp
7 c pp
8 c iii
Id is the primary key
This result is required.
Id name value
1 a pp
3 B iii
4 B pp
6 c pp
8 c iii
Method 1
Delete YourTable
Where [id] not in (
Select max ([id])
For more information about calling large data volumes, see.
For more information about calling large data volumes, see.
The Code is as follows:
Set ANSI_NULLS ON
Set QUOTED_IDENTIFIER ON
Go
Create PROCEDURE [dbo]. [SP_Pagination]
/**//*
***********
For example, if the primary key is required to obtain such results as idnamevalue1app3biii4bpp6cpp8ciii method 1 deleteYourTablewhere [id] notin (selectmax ([id]) fromYourTablegroup
For example: id name value 1 a pp 2 a pp 3 B iii 4 B pp 5 B pp 6 c
During database usage, due to program problems, duplicate data may occur, which leads to incorrect settings in some database settings. Method 1: declare @ maxinteger, @ idintegerdeclarecur_rowscursorlocalforselect main field, count (*) from table
I would like to share with you the most efficient paging query: 50 million levels, which is more efficient than ROWNUMBER and Top.
I would like to share with you the most efficient paging query: 50 million levels, which is more efficient than
During the use of the database, due to the problems of the program, there are sometimes duplicate data, which causes the database to be set up incorrectly.
Method One
Declare @max integer, @id integer
Declare cur_rows cursor Local for select main
With the development of information system, more and more informations are used, and more and more and more and more and more and more and more and more, when the quantity is more and more, this is more and more important in the data display,
First is the stored procedure, which only extracts the data I need, and automatically returns the last page if the page exceeds the total number of data:
Set ANSI_NULLS on SET QUOTED_IDENTIFIER in Go--==========================================
(a) 1, find redundant records in the table, duplicate records are based on a single field (Peopleid) to determine the Select * from people where Peopleid in (select Peopleid from PEO PLE GROUP BY Peopleid have count (Peopleid) > 1) 2, delete
Copy Code code as follows:
/*
Date: 2009-03-19
Function: Get the Game country task list data according to various conditions
*/
Create procedure [dbo]. [Prgs_nation_task_getlist]
@PageSize int = 100--Displays the number of record bars
Copy Code code as follows:
SET QUOTED_IDENTIFIER ON
Go
SET ANSI_NULLS on
Go
ALTER PROCEDURE Usp_paginglarge
@TableNames VARCHAR (200)--table name, can be multiple tables, but cannot be aliased
@PrimaryKey VARCHAR (100),--primary key,
This includes installation prompts for pending operations, shrinking the database, compressing the database, transferring the database to new users for existing user rights, checking backup sets, repairing databases, and so on
(i) Suspend
SQL statement Query method for database duplicate records SQL statement query database duplicate record method SQL statement query database record SQL statement query database duplicate record
Suppose you have an existing list of people (table name:
--drop procedure P_page
--go
CREATE PROCEDURE P_page
(
@Tables varchar (1000)--table name such as TestTable
@PrimaryKey varchar,--table's primary key, must be unique
@Sort varchar = NULL,--sort fields such as f_name ASC or F_name desc (Note that
SQL statements for querying and deleting duplicate records
ASayThere is a field "name" in Table A,and the "name" value may be the same between different records,Now you need to query the records in the table, the "name" value duplicates the item;
Let's look at the knowledge of the relevant data structures first.
There was such an example in the study of linear tables.
Known as a sequential table of integers to store LA, the Trial construct order table lb requires that sequential table lb
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.