T-SQL is a structured query language for Sql-server.Basic data manipulation language.Base statementCreate a table first the following is the list of the use of this table, the list of what is about to look at it ~ ~ Purely to learn the sentence,
A trigger is a special type of stored procedure that differs from the stored procedure we described earlier. Triggers are triggered primarily by an event that is automatically invoked to execute. The stored procedure can be called by the name of the
Baked from somewhere else, you try it out, you can calculate it, but the correct is not quite understand.Use [Niaoren]GO/****** object:userdefinedfunction [dbo]. [Fngetdistance] Script DATE:2017/7/28 Friday 12:17:56 ******/SET ANSI_NULLS onGOSET
When single-table data is too long. We can divide the level, the SQL Server partitioned view to achieve a horizontal table, horizontal division can improve some of the performance of the table.The vertical sub-table is relatively rare to see and use,
Before you create a table, you usually need to determine if the table already exists, and if it does, you do not need to create it, and sometimes you need to determine whether it exists before you delete the table, or you will get an error.There are
Reference articlesHttp://www.cnblogs.com/facetwitter/p/6444706.html?utm_source=itdadao&utm_medium=referralHttp://www.cnblogs.com/jiechn/p/4841865.html1. FreeTDS must be installedConfiguration[Myconfig]Host = 192.168.2.22Port = 1433TDS Version =
The following error occurred while deploying the ASP. MVC4 project to a new machine:System.Data.SqlClient.SqlExceptionThe specific contents are as follows:System.Data.SqlClient.SqlException:"A network-related or instance-specific error occurred
1. Remove the space in the recordLTrim () Remove left space RTrim () Remove right spaceSelect LTrim (RTrim (field name)) from table name.2, increaseINSERT into table_name (column 1, column 2,...) Values (value 1, value 2,....) INSERT into table name
Limitations and Limitations
The shrinking database cannot be less than the minimum size of the database. The minimum size is the size specified when the database was originally created, or the last time you use a file size change
Create a storage step under the master database such as the following:Createproc Killspid (@dbnamevarchar( -)) asbeginDeclare@sqlnvarchar( -)Declare@spidintSet@sql='declare getspid cursor for select spid from sysprocesses where dbid in (select dbid
The leaf page of a clustered index stores the table's data. As a result, table rows are physically sorted by clustered index columns, because table data can only have one physical order, so a table can have only a single clustered index.When we
Create functionDbo.regexreplace (@source ntext,--Original String @regexp varchar( +),--Regular Expressions @replace varchar( +),--Replace value @globalreplace bit = 1,--whether it is a global replacement @ignorecase bit = 0 --whether to
A stored procedure in Transact-SQL, very similar to a method in the Java language, can be called repeatedly. After the stored procedure executes once, the statement can be cached so that the statements in the cache are used directly at the next
1.select query columns, restrictions on columns, where filter rows, restrictions on rows; Group by set operations, such as averaging; having a limit on the value of a set operation, such as a mean greater than 30;order by to the collation limit
1. Querying the user tables in the current databaseSelect *from sysobjects where xtype= ' U ';2. Get the maximum number of simultaneous user connections allowed by SQL ServerSELECT @ @MAX_CONNECTIONS;3. Get connection information for the currently
1. Management of tables-naming of tables and columns
Must start with a letter
Length cannot exceed 128 characters
Do not use reserved words for SQL Server
Only use the following characters A-z,a-z,0-9,$,#,_ and so on
2.
The SQL Server2005 database comes with a sort function row_number (),The list is:Syntax: Row_number (): Over (clause)1. Use the Row_number () function to number:Select Row_number () over (order by Sage) ID, * from StudentPrinciple: Sort by sage
Stored procedures can be used to improve the query efficiency of the database. Because it was compiled beforehand. is stored in memory, before each execution. It doesn't have to be newly compiled, so it's very efficient.A stored procedure is a set
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.