The first method is the most traditional method. The variable in the stored procedure is used as the page multiplier.
CopyCode The Code is as follows: [C-sharp] view plaincopyprint? Create proc p_paged1
@ Pagesize int, @ currentpage int
As
Select
In the database, tables are very important. Most of the data is stored in tables. Operations on tables directly affect the data in the database! Below is my summary in this chapter!
Summary of this chapter! You can directly operate a table, or
CopyCodeThe Code is as follows: -- create a data table createtable testdata
(
Id int identity (1, 1) primary key,
Data int,
Cola varchar (20 ),
COLB varchar (20)
)
Go
-- Insert Test DataDeclare @ counts intDeclare @ I intSet @ counts = 1000
We will summarize several main cases:
I. How to enter a null valueIf you do not enter a null value, if the time is null, "" is written by default, which is troublesome for business processing.
CTRL + 0 to enter a null value.
Ii. How to judge
In SQL Server, the Inner Join and Outer Join operations between common tables are performed by the execution engine based on the selected columns and whether the data has an index, the selected data is selectively converted to one of the Loop Join,
What should we do if we need to modify the SQL server table structure? The following describes how to modify the SQL server table structure.
Add a varchar column to the SQL server table:Alter table distributors add column address varchar (30
Through understanding and summarizing SQL Server database backup and restoration (I), I believe you have a deeper understanding of data backup and restoration, I did not analyze the transaction logs in the above article. Here I recommend song
I. Create a database, create tables, and add constraints.
1.1 database creation
Copy codeThe Code is as follows: use master
Go
If exists (select * from sysdatabases where name = 'mydatabas')-determine whether the database name to be created exists
A view is a common database object that stores query results in a virtual table. The view has many advantages: 1. It can simplify operations, 2. It can set up front-end and back-end buffering, 3. It can combine and split data, 4, the most important
I. Overview of Indexes
1. Concept: a database index is a structure that sorts the values of one or more columns in a data table, just like a directory in a book, indexes provide the ability to quickly query specific rows in rows.
2. Advantages and
When designing a primary key, consider the following:
1. Meaningless: the meaning here is defined from the user's perspective. This meaningless solution also reduces database information redundancy to a certain extent. Some people often refer to
SQL Server 2000Log cleanup tutorial
SQL Server 2000 database logs are too large!How can I clean up SQL Server 2000 logs?How to compress SQL Server 2000 logs?How can I reduce the Log Size of SQL Server 2000?
As far as xiaobian knows, there are many
Copy codeThe Code is as follows: -- Begin Index analysis optimization related SQL
-- Returns the index with the current database fragmentation rate greater than 25%.
-- Run this statement to scan many data pages
-- Avoid running when the system load
On this topic, I also see other methods on the Internet to solve the problem.
However, from the perspective of performance and code volume, I have a better solution.
Here we will share with you.
The principle is actually very simple,
Knowledge 1.
As a little programmer, it is inevitable to deal with where in and like in daily development, in most cases, the parameters we pass are not much simple, single quotation marks, sensitive characters escape, and then directly spelled into the SQL,
It is understood that the vast majority of developers have a thorough understanding of indexing, limited to the fact that most daily work has no chance, and there is no need to care about or understand indexing, when a query is too slow, you can
1, understanding of exists and in (refer to http://www.jb51.net/article/28922.htm)
Exists: TRUE if the subquery contains a row
In: If the operand is TRUE or equal to one in the expression list, it is TRUE.
Exists always cannot understand
Select...
No.
Standard landCode)
Segment encoding (sectCode)
1
131001BG001
G001
2
131001BG002
G001
3
131001BG003
G001
4
131001BG004
G002
5
131001BG005
G003
Now you need to
Just take notes. Nothing !!
Copy codeThe Code is as follows: -- create a test table
Create table [dbo]. [Student] (
[ID] [int] IDENTITY (1, 1) not null primary key,
[Name] [nvarchar] (20) not null default (''),
[Age] [int] not null default (0
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