Not long ago, after the servers hosted in the IDC room were configured, they returned to the company and wanted to work with peace of mind.
I did not expect that I often find it in a few days.ProgramThe operation is not normal.The last check
In MySQL, you can use limit to query records from column M to column N. For example:
CopyCode The Code is as follows: Select * From tablename limit m, n
However,The limit statement is not supported in SQL Server. What should we
1. Full table Query
List the data in the entire table. I don't know why. BerkerlyDB is slower than SQL Server. If there is no reason, I may be useless.
2. getByPrimaryKey
In the case of 19 fields in a table with 33606 data entries: the
1. Simple instances
1. First, let's look at the simplest stored procedure.Create procedure dbo. testProcedure_AXASSelect userID from USERS order by userid descNote: dbo. testProcedure_AX is the name of the stored procedure you created. You can
@ RowcountReturns the number of rows affected by the previous statement.Syntax@ RowcountReturn typeIntegerNoteAny statement that does not return a row sets this variable to 0, such as the if statement.ExampleIn the following example, execute the
-- Obtain the version number of MS SQLExecute master .. sp_msgetversion
-- Obtain the hard disk file information-- Parameter description: directory name, directory depth, and whether to display filesExecute master .. xp_dirtree 'C :'Execute master ..
Everyone cares about data security. If you don't care about it, you may not realize that it is very easy to access sensitive data on the server. Because SQL SERVER has already considered this for us,Therefore, we can directly use SQL SERVER security
In the previous article, I have briefly introduced the basic information of the Project. Today, I started to optimize the system performance. I am a newbie in terms of performance tuning. I don't have much experience and solid foundation, so I hope
The previous optimization notes were too summarized. Some friends suggested that I write the optimization steps and methods in detail, in this comparison, I will explain in detail how to use ANTS Profiler + SQL Server Profiler to find the bottleneck.
1. sort by strokes of the Last Name:Select * From TableName Order By CustomerName Collate Chinese_PRC_Stroke_ci_as
2. database encryption:Select encrypt ('original password ')Select pwdencrypt ('original password ')Select pwdcompare ('original
Set SQL Server to use ROW_NUMBER without sorting
-- 1. We can see that nhib.pdf is a page written in this way, and it feels easier to write (should it be less efficient ?)-- With is just an alias?
[SQL]With query as (select ROW_NUMBER () over
Table t_lock:
ID is the primary key, and the table has 5 rows of data, 1 ~ 2, 4 ~ 6
Repeatable read:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->SET TRANSACTION ISOLATION LEVEL REPEATABLE
StatementSELECT * FROM database A. dbo. Table A, database B. dbo. Table B B WHERE a. field = B. field
"DBO" can be omitted, as shown in
SELECT * FROM database A... table A, database B... table B B WHERE a. field = B. field
SqlServer database:--
Think twice about partitions:
1. Although partitioning can bring many benefits, it also increases the management cost and complexity of object implementation. Therefore, before partitioning, You need to carefully consider whether to partition the
I used triggers to do things in a short time, and I reviewed them. I found some information from the Internet and added my memories as follows. I only recorded the information for subsequent queries.
Create a trigger:
Code highlighting produced by
1. view the database version
Select @ version
2. view the operating system parameters of the machine where the database is located
Exec master .. xp_msver
3. view database startup parameters
Sp_configure
4. view the database startup time
Select
This is a case from the Microsoft community's elite project. I gave the solution.
Problem description:
Environment Description:Operating System win2003Database SQL SERVER 2000 SP4About GB database data size Specific fault description:Connect to the
-- Create a login user-- Create login login_name from windows with default_database = database | default_language = language;Create login [localhost \ hoojo-pc] from windows with default_database = testHome;-- Create a login user-- Create login
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