First, find the name of the table to be processed or the name of the stored procedure in the system table, and process it with a cursor.
PS: sqlserver 2000 uses the system table sysobjects and the type field is xtype. The system table of SQL
Index
View the index of the Table: sp_helpindex [Table name]
The essence of clustered index is a two-way linked list
The essence of a non-clustered index is a balanced binary tree that uses multi-layer Classification to continuously narrow the
Everyone knows that writing a program should have a good naming convention, which should be posted for convenience of work.1 ADO. Net naming rules
Data Type
Abbreviated Data Type
Standard naming example
Connection
Con
Source: http://www.newasp.net/tech/data/2430.html
Abstract: factors that affect the performance of SQL Server databases and the principle of optimizing SQL server performance,Keywords: SQL Server database performance optimization QueryDesigning an
This article from: http://www.baanerp.com/post/48.html
A data type is a type of data attribute, indicating the type of information represented by the data. Any computer language defines its own data type. Of course, different programming languages
--SQL Server text field string replacement example processing script
/* -- Text field replacement--*/-- Create a data test environment-- Create Table # Tb (AA text)Declare @ s_str varchar (8000), @ d_str varchar (8000), -- Define the replacement
If two user processes lock different resources and attempt to lock the resources locked by the other user, a deadlock will occur. At this time, SQL Server automatically selects and terminates one of the processes to remove the deadlock, so that
Date:2006-07-19
Click:23
Author:
Source:Webpage tutorial Network
First, place the file to be restored in the data file in ms SQL. after entering the ms SQL master database server
1. We use the default method to create a database for recovery (such
1. Export the table:
Select top (1, 100) percentCase when a. colorder = 1 then D. Name else ''end as table name, case when a. colorder = 1 then isnull (F. Value ,'')Else ''end as table description, A. colorder as field serial number, A. Name as
Sp_executesql
Execute statements or batch processing that can be reused multiple times or dynamically generated. Transact-SQL statements or batch processing can contain embedded parameters.
[For details, refer to SQL Server online help]
Here is a
1. String Functions
Length and Analysis
Datalength (char_expr) returns the number of characters in the string, but does not contain spaces
Substring (expression, start, length ).
Right (char_expr, int_expr) returns int_expr characters to the right
Update is one of our common SQL statements. Update is mainly used to change the existing data in the table.
Update a table: Update product set l_parentid = '1'
Detailed Description: Update table name set column name = parameter
Update two or more
SQL ServerSyntax
For ease of instruction, the database uses the example database of SQL Server, northwind and pubs. If SQL server does not exist, you can install it as follows:
1. Download sql2000sampledb. MSI, which
due to the diversity of business logic, SQL Server often needs to query data in different databases, which leads to the need for distributed query.
Now I will summarize several types of queries encountered in development as follows:
1. Access
Today, one of my colleagues demonstrated how to use the extended stored procedureXp_mongoshellTo activate the windowsGuestAccount and clear the password of that account, and then add the Guest account into the windows Administrators Group. after all
RulesA rule is a backward compatible feature that is used to execute functions that are the same as check constraints. Check constraints are the first standard method to limit column values. Check constraints are more concise than rules. A column
Table name prefix t
Field name prefix F
View name prefix v
Use camel for variable naming
Stored Procedure USP _
The stored procedure uses the Pascal naming convention. When multiple developers develop, add the module word prefix, for example,
-- String Function
-- Substring
Print substring ('iamagoodperson)
Select substring ('iamoodperson)
-- Upper
Select upper ('he is a good person ')
-- Lower
Select lower ('this is an very interesting job ')
-- Ltrim
Select ltrim ('I am a good
Microsoft provides three main methods for optimizing queries:
Use set statistics Io to check the read and write operations generated by the query;
Use set statistics time to check the query running time;
Use set showplan to analyze the query
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.