SQL is short for structured querylanguage (Structured Query Language). It is a type of database query andProgramA design language used to access data and query, update, and manage relational database systems. It is also the extension of the database
The dynamic memory allocation mechanism introduced by SQL Server 2000 is generally unable to recycle the memory well, especially on the website server. A period of time may cause excessive memory consumption on the machine. If the computer is not
1. What is the database size?
Exec sp_helpdb
Select * From sysfiles
2. query a database space
Use dbname
Sp_spaceused
3. query a tablespace
Sp_spaceused tablename
4. view the log file content
DBCC log (dbname, type = 4)
1 string Function1.1 length and AnalysisDatalength (char_expr) returns the number of characters in the string, but does not contain spacesSubstring (expression, start, length ).Right (char_expr, int_expr) returns int_expr characters to the right of
1. Three backup modes
Full backup, differential backup, and log backup
2. database recovery model
Full recovery, large-scale Log Recovery, simple mode
Switch Recovery Model: Right-click the database name, select Properties, select options, and click
SQL Server triggers (10)
I. Most T-SQL statements can be used in statement triggers that cannot be used in triggers, but the following statements cannot be used in triggers.
Create statement, such as create database, create table, and create
A transaction is a mechanism and an operation sequence. It contains a group of database operation commands. All the commands will be used as a whole, and they will be submitted or revoked together to the system. The requests will either be executed
1. Enter the Enterprise Manager of Microsoft SQL Server.2. Select the database for which you want to restore Data, right-click the database, and select all tasks from the context menu to restore the database.3. Select recover database from the
Document title: Data Conversion Between SQL Server and access and Excel by Li honggen
Key words: SQL Server, access, Excel, Data Conversion
In this paper, the conversion from C ++ builder research-http://www.ccrun.com/article/go.asp? I = 638 & D =
/*************************************** ************************ File: fndateinterval. SQL** Name: fndateinterval** Description: Get the interval between the start date and the end date.Use the format as "number years and number months and number
----------------------------------------------------------------------------
---- This is andkylee's personal originality. Please repost it with respect to the author's Labor achievements;
---- The original source must be specified for reprinting.
:
Syntax:Create [index type] Index nameOn Table Name (column name)With fillfactor = fill factor value 0 ~ 100Go
/* Instance */Use Database NameGoIf exists (select * From sysindexes where name = 'ix _ test_tname ') -- check whether the ix_test_tname
5.2 clustered indexes (Clustered index)(Page 122)
The clustered index determines the physical order of a table's data. Therefore, a table can have a clustered index. Limit 5.1 indicates the structure of a clustered index.
Fig 5.1
The structure of
Delete TB where ID> 100DBCC checkident ('tb', reseed, 1)DBCC checkident ('tb', reseed)-- The result sets the auto-incrementing seed of the TB table to the maximum value of the ID column in the current table.-- Add the data again and the number will
/*Environment:
Local (XP + sql2005 ):Select @ version
Icrosoft SQL Server 2005-9.00.1399.06 (Intel x86)Oct 14 2005 00:33:37Copyright (c) 1988-2005 Microsoft CorporationDeveloper Edition on Windows NT 5.1 (build 2600: Service Pack 3)Data Server (Win20
DBCC dropcleanbuffersDBCC freeproccacheSet statistics time on; With T(Select 1 as numUnion allSelect num + 1From tWhere num )Select * from tOption (maxrecursion 0)Set statistics time off/*DBCC execution is complete. If DBCC outputs an error message,
SolutionSQL ServerInstallation pending
When installing SQL Server, the following error occurs: "A previously installed program has created a suspended file on the installation computer. You must restart the computer before running the installer.
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