SQL Server2000 paging Stored Procedure
Create procedure [DBO]. [getrecordwithpage]
@ Fieldstype nvarchar (1000), -- Field List (with type), used for field declaration of @ t table variables, such as photoid int, userid int, phototitle nvarchar (50
Store common or complex tasks in advance with SQL statements and a specified name, to enable the database to provide services with the same functions as the predefined stored procedure, you only need to call execute to automatically complete the
No nonsense. Check the Code:1. First, I used a stored procedure to solve this problem. To understand this problem, I should first start with the stored procedure. The Code is as follows:
Create proc getdataset@ Tablelist
Drop procedure propageset
Go
Create procedure propageset@ TB varchar (50), -- table name@ Col varchar (50), -- pagination by this column (it must be a unique character, such as the identification seed)@ Colorder varchar (50), -- the field to be
[Original] A knowledge point caused by memset
When debugging a base Sorting Problem, I want to assign an initial value to the int * that was initially allocated, similar to zeromemory on windows, but I found that things are not that simple.
Cs page call code:
Copy codeThe Code is as follows: public int TotalPage = 0;
Public int PageCurrent = 1;
Public int PageSize = 25;
Public int RowsCount = 0;
String userid, username;
Public DataTable dt = new DataTable ();
Public string path,
Copy codeThe Code is as follows: -- according to the MAX (MIN) ID
Create proc [dbo]. [proc_select_id]
@ Pageindex int = 1, -- current page number
@ Pagesize int = 10, -- size of each page
@ Tablename VARCHAR (50) = '', -- table name
@ Fields VARCHAR
Recently, I am doing a paging query of several million pieces of data. I have studied various solutions and tested it with the actual database of the project on the local machine. The testing process is very, which is so painful that I cannot look
Using system;Using system. collections;Comparison and sorting of namespace Sets{Public class efficience: icomparable{Private int workhour;Private int output;Int icomparable. compareto (Object OBJ){If (OBJ = NULL)Throw new argumentexception
Sort out the paging stored procedures for each database used in the project.SQL Server2000 paging stored procedure:Create procedure p_page_data(@ Currentpageindex Int = 1,@ Pagesize Int = 10,@ Countrecord int output)AsDeclare @ currentpagesize int
Stored Procedure code:CREATE proc page@ RecordCount int output,@ QueryStr nvarchar (100) = 'table1', -- table name, View name, and query statement@ PageSize int = 20, -- size of each page (number of rows)@ PageCurrent int = 1, -- the page to be
1. The database structure is as follows: (after creating a database in SQL, execute the following SQL script directly in the SQL structure queryer)If exists (select * from dbo. sysobjects where id = object_id (n' [dbo]. [Mobile] ') and
-- Based on MAX (MIN) ID The code is as follows:Copy code Create proc [dbo]. [proc_select_id]@ Pageindex int = 1, -- current page number@ Pagesize int = 10, -- size of each page@ Tablename VARCHAR (50) = '', -- table name@ Fields VARCHAR (1000) =
Mssql stored procedure page (total number of pages returned at the same time)There is no convenient limit paging like MySql. If you need to query data by page in MSSQL, you have to write the stored procedure...The not in method has poor paging
The custom page of The DataGrid is an important function of the DataGrid. The custom page of The DataGrid is mainly used for large data sources. Because the data source is large (with many records), loading takes a long time, slow response, and
-------------------------------------------------------------------------------- Login Stored Procedure------------------------------------------------------------------------------------ @ Islogin:-1: Password error 0: User name does not exist; 1:
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.