following commands in the query Analyzer:
1. External Connection1. Concept: including left Outer Join, right Outer Join or complete external join
2. Left join: left join or left Outer Join(1) The result set of the left Outer Join includes all rows in the left table specified in the left outer clause, not just the rows matched by the join column. If a row in the left table does not match a row in the right
following commands in the query Analyzer:
1. External Connection1. Concept: including left Outer Join, right Outer Join or complete external join
2. left join: left join or left outer join(1) The result set of the left outer Join includes all rows in the LEFT table specified in the left outer clause, not just the rows matched by the join column. If a row in the left table does not match a row in the right
Currently, the projects at hand are made of LINQ, EF, and MVC, And I am confused by cainiao. Two days ago, I finally had some free time, and it took me some time to solve a long-standing question: When did EF submit a query to the database? Now let's share my little gains.
Why do I have the following questions:
Use the SQL database northwind and simple ASP. NET WebsiteProgramFor example, create a new de
V_cust_rcvlbesWHERE postcode> "98000"The number of rows in the view is less than the rows in the primary table, and the physical order is the required order, reducing disk I/O, so the query effort can be significantly reduced. 23, you can use distinct without GROUP bySELECT OrderID from Details WHERE UnitPrice > Ten GROUP by OrderIDCan be changed to:SELECT DISTINCT OrderID from Details WHERE UnitPrice > 10 24. Use UNION ALL to not use UnionUNION all
A problem that has been resolved for a long time today,
The cause isObtain the data with the maximum time and date.
Previously, we thought that only the MSX function could solve the problem,
Select * From tablename where date = (select max (date) from tablename) and time = (select max (time) from tablename)
During the test, we found that a piece of data was taken out. Because the test was performed on two pieces of data in a day without a different date, we thought it was correct on that day
Determine the installed SQL Server 2000 Database Components version
Use isql, osql, or query analyzer to Perform one of the following queries on Database Engine instances.
Select serverproperty ('productlevel ')
SELECT @ VERSION
Select serverproperty ('productversion ')
Use the following table to determine your Database Components version.
the table specified for that hint to be read-only in Gianpene.16, with Profiler to track the query, get the time required to query, find out the problem of SQL; Use the index optimizer to optimize indexes.17, notice the difference between Union and union all. UNION all good.18, pay attention to use distinct, do not need to use, it is the same as the Union will m
returned by the user or set rowcount to restrict the operation of the line
22, in the SQL2000 before, generally do not use the following words: "Is NULL", "23. Use Query Analyzer to view query plans for SQL statements and evaluate whether the analysis is optimized for SQL.
@ Ftech Is Not Null Begin If @ Sqlstr Is Not Null Set @ Sqlstr = @ sqlstr + 'And ftech =' + '' '' + @ Ftech + '' '' Else Set @ Sqlstr = 'Where ftech =' + '' '' + @ Ftech + '' '' End If @ Fsubject Is Not Null Begin If @ Sqlstr Is Not Null Set @ Sqlstr = @ sqlstr + 'And fsubject =' +'' '' + @ Fsubject + '' '' Else Set @ Sqlstr = 'Where fsubject =' + '' '' + @ Fsubject + '' '' End If @ Fjif Is Not Null Begin If @ Sqlstr Is Not
Qian's lines: witness the miracle of the moment, we re-execute the previous query:From the above example, you can see the power of the indexed view, even if your query statement does not include the indexed view, the Query Analyzer will automatically select this view, which greatly improves performance. Of course, so powerful performance, only in
often forget! Access In the recent writing Web program used the fuzzy query access, in the Acces write code how can not find records, later only up the original acess and SQL Server fuzzy query is a specialCondition: Lookup Table A in the Name field includes "B" in the recordCode in Access: 1 Select * from a where name like ' *b* '
can not find records, later only up the original acess and SQL Server fuzzy query is a specialCondition: Lookup Table A in the Name field includes "B" in the recordCode in Access:1 Select * from a where name like ' *b* ' SQL Server Query Analyzer codeSelect * from a where n
the Acces write code how can not find records, later only up the original acess and SQL Server fuzzy query is a specialCondition: Lookup Table A in the Name field includes "B" in the recordCode in Access: 1 Select * from a where name like ' *b* ' SQL Server Query Analyzer c
expression that is to be converted to a float or real data type can optionally contain an exponential symbol (E or E, followed by an optional + or – symbol, followed by a number).When you convert a character expression to a data type of a different size, values that are too long for the new data type are truncated, and SQL Server displays an asterisk (*) in the osql utility and SQL
considerations for improving query speed, but in many other cases, it is often necessary to repeatExperiment with different statements to get the best solution. The best way to do this, of course, is to look at the SQL language that implements the same function.Which run time is the least. However, the database assumes that the amount of data is very small, is less than the comparison. You can then use the
A
WHERE rownumber > page Size * (page-1
Description, Page size: Number of rows per page; pages: pages. When using, replace "page size" and "page size * (number of pages-1)" with numbers. Other scenarios: If you don't have a primary key, you can use a temporary table, or you can do it with scenario three, but the efficiency will be low. When tuning is recommended, the query efficiency increases with the prima
connections is much faster than looping nesting. From the principle of merging joins it is not difficult to imagine that merging connections first requires both parties to be orderly. And the condition of the join is equal to the number. Since two input conditions are already in order, it is not difficult to see why the merge join is only allowed to be equal to the join after a row is compared from each input set, equal returns, and unequal discards. We can see this principle from the icon in F
Determine which SQL Server Database components version is installed
Use isql, osql, or Query Analyzer to execute one of the following queries against the database engine instance.
SELECT serverproperty (' ProductLevel ')
SELECT @ @VERSION
SELECT serverproperty (' ProductVersion ')
Use the table below to determine your version of Database components.
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.