Easy to delete all the data tables in the database, empty the database, some constraints, not directly delete, you need to delete the constraints in the library, the code is as follows
Copy Code code as follows:
--Delete all
There are two ways to get the execution plan :
1, one is to open some switches in front of the instruction, let the execution plan information hit in the result set, this method is more suitable in a test environment for a single statement
File:. wmv; Size: 19,535kb; Length: 00:26:39.
Download Address: Sqlfunction_udf_week.rar
The following is updated on 20120105:
2012 just arrived, the software developed uses this function to discover bugs. The first week of 2012 should be 2012-01-01
In view of the serious shortage of manpower (at that time, the resources of two and a half people), the idea of manually changing libraries was discouraged. The current program structure is not allowed to engage in revolutionary practices, only to
[SQL]
--=================== "Create a stored procedure" =====================
Use [message]
Go
/****** object:storedprocedure [dbo]. [Read external database query] Script date:10/24/2012 05:39:16 ******/
SET ANSI_NULLS on
Go
SET QUOTED_IDENTIFIER ON
Myth #22: Resource regulators can control IO
Error
The resource Governor is unable to control Io, and the next version of SQL Server is expected to support regulatory IO, which is useful for reducing the performance impact of scan operations on
Myth #21: Database corruption can be resolved by restarting SQL Server or Windows, or by attaching and detaching databases
Error
None of the operations in SQL Server can repair data corruption. Damaged pages need to be repaired or restored by some
Misunderstanding #14. The associated LSN is populated with 0 when the log is cleared.
Error
The log files are manually grown, automatically grown and created with a 0 initialization operation. However, do not confuse this process with the
Myth #7: Multiple mirrors can exist for a database
Error
This myth is a bit of a cliché. Only one mirror server is allowed per principal server. If you want to have copies of multiple principal servers, use transaction log shipping, which
This also reduces the CPU cache hit failure (click on this link to see how the CPU cache works and the Mesi protocol). Let's debunk three common myths about null bitmaps.
myth #6a: A null bitmap is not always usedThat's right
Even if there is no
Myth #2: DBCC checkdb can cause blocking because this command is locked by default
This is wrong!
In SQL Server 7.0 and earlier versions, the nature of the DBCC checkdb command is a constantly nested loop of code implemented in C and table locking
method One: Take advantage of SQL Server Agent (alert+job) The following are the steps: 1. First use the following command to enable the tracking flag. SQL Code DBCC traceon (3605,1204,1222,-1) Description: 3605 outputs DBCC results to
Note: "Repeat" here is not a complete repetition, meaning a field data duplication
HZT table Structure
ID int
Title nvarchar (50)
Adddate datetime
Data
One. Find duplicate records
1. Find all duplicate records
SELECT * FROM table Where repeat field
"From Mencius E blog" Recently did a small Java project (first write Java project), to search the internet for a long time, found a better example of the call stored procedures, and the Internet is commonly used is setxxx (int parameterindex, XXX x)
Begin:In testing, in order to simulate orders, there is a requirement for the DBA, how to quickly batch generate orders through the background database script.AnalysisStanding in the database perspective, bulk generate orders, which is the bulk of
mssql-Agreement:Shared memory: The most efficient, in-memory operation, can be used for this machine, with. or (local) on the loginNamed pipes:winodows with Windows Communication protocol, machine name communication, generally not usedTCP-IP:
-----------------------------system stored procedures----------------------------------List the databases in the SQL Server instanceSp_databases--Returns a list of attribute names and matching values for the SQL Server, database gateway, or
When a system uses a lot of tables, and there are a lot of stored procedures, when a table in the database deleted a field, then the corresponding stored procedures need to be changed, but we do not know which stored procedures used the field, then
CREATE PROCEDURE [dbo]. [sp_dbbackup_everynight_local] @cycle int,---save period @islocal int,---is local 0 means 1 means no @savepath NVARCHAR,---file save path \ \ 192.168.19.102\databaseback@dbprefix NVARCHAR (,---) generates a file prefix
Missing indexCase: There are a number of interface requests failed on a certain line, and the CPU usage is high on the server. The Activity Analyzer (a recent resource-intensive query) found that several queries had CPU time (milliseconds/sec) of
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.