Requirements: Because the project has just uploaded, no votes, in order to show a certain popularity, it is necessary to start at the beginning of the number of votes to assign a value,But every project can not be the same, otherwise easy to see the
1. Is index fragmentation generated?The index page splits because of a large number of insertions, modifications, and deletions in the table. If the index has a high fragmentation, there are two cases, one is that scanning the index takes a lot of
Requirements: Because the project has just uploaded, there is no votes, in order to show a certain popularity, it is necessary to start at the beginning of the number of votes to assign a value,But each project can not be the same, otherwise easy to
Yesterday examined a very inefficient table, two years without maintenance, logical scan fragments up to 99.Bayi%, the table is then started to focus on tracking and logging. Today, the DBCC SHOWCONTIG with tableresults command examines all of the
1. We may encounter such a situation in the development process "when we carry on the maintenance of other people's projects or two development of the project may be the original data Table Analysis", here is a convenient way to generate a database
Database storage query (the size of the database and the amount of data in each table in the database and the size of each row of records)IF not EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id (N ' [dbo].[ Tablespaceinfo] ') and
(1) Stored procedures[1] Creating a stored procedure (no parameters)CREATE PROCEDURE ProtestaAsSELECT * FROM TestA--Modify the stored procedure (with parameters as output)Alter PROCEDURE Protesta@LastName varchar = NULL outputAsIf @LastName is
Recently, I have been clearing unnecessary jobs and found several MDW-related jobs. Although the Job has been Disable, it has not been deleted. The following error occurs when you try to delete a file: Deleted
Recently, I have been clearing
Sometimes, the administrator of a database needs to merge the data in several different databases. If the structures of several databases are basically the same, only one database needs to be created, you can copy and append objects in several other
Search for keywords from all tables and all databases
-- 1 simple query: Search for keywords in all tables
Declare @ STR varchar (100)Set @ STR = 'A' -- string to be searched
Declare @ s varchar (8000)Declare TB cursor localSelect 'if exists
The attack is targeting Microsoft IIS web servers. Is it exploiting a Microsoft Vulnerability?Yes and no. web developers (or their employers who did not mandate proper security education) are to blame for each single infection, because the SQL
One day, I was trying to clear the database again. The depressing result was that I didn't have the permission to delete the database, let alone create a new database. Sorrow. I want to write an SQL statement to delete all user-defined data tables
SQL Batch ProcessingBatch Processing: [Define] A group of complete data and SQL commands (one or multiple SQL commands can be included) passed from the client to the server to form a batch processing.
(1) If a syntax error exists in a batch, the
Cursor
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> Declare @ ID Int , @ PID Int , @ Ver Int Declare # Cur Cursor For Select 1 As ID, 1 As
1. In the first case, replace all the specified injection strings (only the injected strings are empty)
Declare @ delStr nvarchar (500) set @ delStr = ' '-- the injected field string /************************* ********* * **/set nocount ondeclare @
Batch delete database SQL statements and batch Delete SQL statements
Because of project requirements, you need to create a database every time you run case. Although it will be deleted at the end of each execution, it is not guaranteed that the
Since executing the cursor is equivalent to executing the SELECT statement, the efficiency is not flattering and has not been studied in depth.
Copy codeThe Code is as follows: table1 structure:
Id int
Name varchar (50)
Declare @ id intDeclare @
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.