In-depth analysis of SQL Server triggers and SQL
A trigger is a special type of stored procedure, which is different from the stored procedure we introduced earlier. A trigger is triggered by an event and automatically called for execution. The stored procedure can be called by the name of the stored procedure.
Ø what is a trigger?
A special stored procedure that
sample time.4,% User time represents CPU-intensive database operations, such as sorting, executing aggregate functions, and so on. If the value is high, consider increasing the index, using a simple table join, and horizontally splitting the large table to reduce the value. Physical DISK:CURRETN Disk Queue Length counter this value should not exceed 1.5~2 times the number of disks. To improve performance, you can increase the disk. Sqlserver:cache hit Ratio counter the higher the value, the bet
Rea Hat provides a similar tool for SQL Storage Compress, and boasts a compression ratio of up to 90%. The SQL Storage Compress provides a 14-day usage version, and the installation starts the Hyperbac control Service after downloading. This service compresses or compresses SQL Server's read and write requests in conjunction with Windows I/O Manager, and has no e
XML clause in the SELECT statement. This is ideal for data interchange and WEB service applications. The inverse function for XML is a relational rowset generator function named OpenXML, which extracts the value from the XML data and places it in the column of the rowset by asking for the value of the XPath 1.0 expression. The application uses OpenXML to "shred" incoming XML data and store it in a table, or for queries in the T-SQL language.
Cli
there is no srvid = 0 or srvid = 0 (that is, the current machine) but the srvname is different from the datasource, You need to modify it as follows:Use masterGo-- Set two variablesDeclare @ serverproperty_servername varchar (100 ),@ Servername varchar (100)-- Obtain information about the Windows NT server and the instance associated with the specified SQL server
format.
After introducing Sarg, let's summarize the experiences of using Sarg and drawing different conclusions from some materials in practice:
1. Whether the like statement belongs to the Sarg depends on the type of the wildcard used.For example, name like 'zhang % ', which belongs to Sarg
However, name like '% Zhang' does not belong to Sarg.The reason is that the wildcard % is enabled in the string so that the index cannot be used.
2. or may cause full table scan.Name = 'zhang san' a
SQL Server has an SQL profiler that can track the SQL statements executed by the server in real time, which is useful in many times for debugging errors. For example, the complexity of othersCode, Production system, no debugging environment, no original code ......
After c
Author: south_titanArticleAttribute: Original Copy Link
SQL Server Export and Import Author: Yang Xiao (http://blog.sina.com.cn/u/1237288325) Because of the company's project requirements, the database is imported and exported between two databases. I have studied SQL Server Import and Export and found th
SQL Server provides daily and monthly data reports, and SQL monthly data reports.
This example describes how to use SQL Server to implement daily and monthly data reports. We will share this with you for your reference. The details are as follows:
-- 320,
or less than 32.
Code Page value descriptionAcp ansi/Microsoft Windows? (ISO 1252 ).The default code page used by the OEM Program. If-C is not specified, this is the default code page used by bcp.RAW does not convert data from one code page to another. Because no conversion occurs, this is the fastest option.
-T field_term
Specifies the field Terminator. The default field Terminator is \ t (Tab ). Use this parameter to replace the default field Termi
) from sysprocessesGROUP BY Nt_usernameOrder by count (0) descIf one of the SQL Server user name Test connections is more, view the host name it came from:Select Hostname,count (0) from sysprocesses where loginame= ' test 'GROUP BY hostnameOrder by count (0) descIf a SQL Server user name Test connection is more, view t
CONVERT (varchar), GETDATE (), 126): 2006-05-16t10:57:49.827Select CONVERT (varchar), GETDATE (), ():???? ?????? 1427 10:57:49:907amSelect CONVERT (varchar), GETDATE (), 131): 18/04/1427 10:57:49:920am2. SQL Server date and time functions1. Current system date, timeSelect G
Add Several SQL Server statements and stored procedures to Favorites (standardization is getting closer and closer): namespaceprefixonsurn: schemas-microsoft-com: office
Add Several SQL Server statements and stored procedures to Favorites (standardization is getting closer and closer): namespace prefix = o ns = "urn: s
COALESCE (InputParameter, ") to convert null to";B. Input type is integral type, and allowed to be empty, you can use COALESCE (inputparameter,0), the idling switch to 0;C. If the input parameter is a character type and is non-empty, you can use COALESCE (InputParameter, ") to convert null to", and then determine whether the return value of the function is ";D. The input type is integer and is non-null and
content will also be disordered, and insertion will fail. Therefore, the column name is specified.
-----------------------
/** // * 2. Insert data in the Excel table to the SQL database and create an SQL table (the definition and content of Excel are the same as above ):*/
Select convert (INT, ID) as ID, fname into test7
From OpenDataSource ('Microsoft. jet. ole
)--datename gets the string for the specified part select Datename (Weekday, ' 2013-2-17 ') --Return Sunday (parameter weekday can be changed to day,year etc. date plus corresponding value)--day (), Month (), year () gets the string for the specified part select Day (' 2013-2-15 ')--return 15Convert Date conversion functionTime format conversion using convert:convert (data_type [(length)], expression [, style])Data_typeThe data types provided by the target system, including bigint and sql_varia
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.