1. Common analysis statementsDBCC freeproccache -- clear CacheDBCC dropcleanbuffers -- clear the Buffer Zone
-- Get performance informationSet statistics profile on
Set statistics Io on
Set statistics time on
Use the set statistics XML on
Run SQL Server Profiler to generate and connect to the database. Normal. When you click Run To Start tracing, the error "only TrueType fonts are supported. There id not a TrueType font" is returned ". Microsoft has made great progress. It seems that
When the log file is full and the SQL database cannot write the file, you can use either of the following methods:Method 1: Clear logs.1. Open the query analyzer and enter the commandThe following is a reference clip:Dump transaction database name
Method 1:Step 1:BackupLogDatabase_name with no _Log Step 2:Compress all data and log files of a specific database and execute DBCC shrinkdatabase (database_name)
Method 2: Another method is risky becauseSQLServer log files are not written to
In reverse engineering, this trick is very practical. If it is a R & D personnel, go directlySource codeSearch in the control tool.
After testing, any of the following queries can meet the needs of the questions.
An SQL statement for data query must be evaluated by SQL Server and generate the corresponding execution plan. Finally, the actual query operation is generated based on the Execution Plan and the result set is returned to the client, evaluating and
First, I declare that this is my answer. It is not an official answer. Do not blindly pursue it because I think this question is representative and many people want to know it, by the way, you can also score yourself. Because I usually use sqlserver2
-Deadlock. In short, two or more trans simultaneously request an object being requested by the other party, causing both parties to wait for each other. A simple example is as follows:
Trans1 trans2
---------------------------------------------------
The following script demonstrates how to use a Gmail account in SQL Server 2005/2008 to configure the database email function.
-- ===================================================== ============
-- Enable database mail
-- ========================
In our applications, we sometimes need to delete the primary keys of some tables first, and then do some exception operations, and then re-create the primary keys, but we do not want to use SQL server manager studio or, when using code in a program
SELECT'Table name' = case when a. colorder = 1 then d. name else' 'end,Table description = case when a. colorder = 1 then isnull (f. value, '') else'' end,FIELD No. = a. colorder,Field name = a. name,Id = case when COLUMNPROPERTY (a. id, a. name,
-- Shows all user tables and row counts for the current database
-- Remove OBJECTPROPERTY function call to include system objects
SELECT o.NAME,
i.rowcnt
FROM sysindexes AS i
INNER JOIN sysobjects AS o ON i.id = o.id
WHERE i.indid
AND
Today, we are studying the full-text retrieval function of SQL Server. Some good information found on the Internet:
[SQLSERVER] Full-text retrieval in SQL)Instance demonstration enable full-text search in SQLUse full-text retrieval of SQL SERVER 2000
Functions in SQL Server)1. Because the stored procedure cannot be used in update, it must be calculated based on some fields in the update table. We often use the cursor method. Here we use the Function Method for implementation.
Function
Select hardware
Choosing the best hardware for your SQL Server application involves many factors, such as the size of the database, the number of users, and the way the database is used (OLTP or OLAP. Although there is no success formula to
If only the FOR keyword is specified, the default value is the AFTER trigger.
========================================================== =-- Insert triggerCreate trigger tri_insertOn studentFor insertAsDeclare @ student_id char (10)Select @
C # Use Guid. NewGuid (). ToString ()
Use NEWID () in SQL ()
The above method generates a 36-bit GUID. If you want to convert it to 32-bit, replace the '-' character.
SQL method: replace (newid (),'-','')
-------------------------------------
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->N to m rows
1. select top m * from tablename where id not in (select top n id from tablename order by id asc/** // * | desc */)
2. select top m *
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.