SQL Server automatically creates a database named tempdb for use as a workspace, when you create a temporary table in a stored procedure, such as (Create TABLE #MyTemp), regardless of which database you are using, The SQL database engine will create
In the Web, security is mainly embodied in two aspects: one is the program security, that is, to prevent the Web page in the insertion of malicious code, the other is database security, which we can often back up the database to achieve.
In the
--╔════════╗--===============================║if Statement Use example ║--
╚════════╝declare @a int set @a=12 if @a>100
Begin print @a end ELSE begin print ' No ' end--╔══════════╗--==========
The ==========
I. BACKGROUND
The problems we encounter are shown in the following illustration: Automatic growth is growing in such proportions;
(Figure1: Where the problem lies)
If you try to modify the automatic growth value using SSMS, the following error
Problem scenarios
When you migrate a SQL Server database, you need to re-create the user accounts on the previous database after you restore the database backup files on another server. When you create a logged-on user, you need to authorize the
Syntax for SUBSTRING:
SUBSTRING (expression, start, length)
Expression
A string, binary string, text, image, column, or an expression that contains a column. Do not use an expression that contains aggregate functions.
Start
An integer or an
A. Stored procedures
1. Classification of stored procedures
A stored procedure is a database object that is stored in a database and can be executed by an application through one call, and
Allows users to declare variables, perform conditionally,
Brief introduction
When the query optimizer (queries Optimizer) parses a T-SQL statement and selects the least-consumption execution plan from the execution plan, the specific execution is performed by the execution engine (Execution Engine). This
How do you know how efficient an SQL statement is, knowing only 3 of the following:
1. Analysis of disk activity (IO) information through SQL statement execution:set STATISTICS io on (open)/ set STATISTICS iooff (closed)
2. Time spent parsing,
Many SQL Server programmers are confused about the use of subqueries (subqueries), especially for nested subqueries (that is, a subquery that contains a subquery). Now, let's look at this question in the right way.
There are two types of seed
After you have selected the components, the next step is to install the individual components.
The first thing that needs to be configured is the service account. Choosing the right service account is very important, and if it is a local test
In fact, a lot of friends have asked recovery Interval, have asked this is why, have asked how to adjust this value, so write a small blog today, once and for all.
As we all know, SQL Server relies on log to ensure performance and data persistence
It is well known to mention like statements, for example, to find all users with "C" in their username, we can use the MyDatabase select * FROM table1 where username '%c% '
Here's another way to write the above function:use mydatabase select * from
Two servers with two SQL Server A, B
A,B table Structure A,b the same
A,b will do some insert,update,delete operation, require the data of AB to keep consistent
(That is, a new data, request B also add, a change a piece of data, B also change the
Environment: SQL Server 2008 R2
Question: The annotation usage in SQL Server is not clear.
Solve:
Single-line Comment:--
Multi-line Comment:/*......*/
Use examples:
Single-line Comment:
-The column ' Student.sname ' in the select list is
Let's take a look at the following table and the data:
T_product
Figure 1
The table has two fields: XH and Price, where XH is the primary index field, and now you have the following query results:
Figure 2
As you can see from the query
Problem
Database backups occupy a very important place in the day-to-day tasks of the database administrator. This task is typically done through maintenance plans, regular SQL Server Agent jobs, or the execution of Third-party tools. Given the
A database snapshot is a read-only copy of a database that is a map of all data in a database, and determines its content by the point at which the snapshot is executed. This article describes how to manipulate database snapshots through an instance.
This article uses an example to illustrate how optimistic locking and pessimistic locking can be used to solve a multiuser concurrency situation where other users have modified the data you want to modify to create inconsistencies in the data.
In
This article explains the use of triggers, which is important to understand the inserted process. When an UPDATE statement is executed on a table that has a trigger defined, the original row (pre-image) is moved into the deleted table, and the
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.