1: Use partitioned tables to improve database performance
Many of the previous processing of large amounts of data took the form of using multiple structured tables to be grouped by time, there are different data tables for data at different times, so if you want to query only one table's data quickly, if you need to cross table queries and then connect the tables to the table in a connection view, you can improve query efficiency , but at the expense of the elegance of programming and the simplicity of database design, especially when dealing with relationships, constraints, data integrity is very cumbersome and complex.
Upgrade to sql2005 can use the partition table (partition table) to handle this requirement, we can write our partitioning rules as partition functions, and then our partition table can follow this partition function to store our table on different storage media, when we query the SQL The server optimizer automatically selects partitions for joins, which is much more effective than a large number of filters.
2: Add a serial number to the query result set by Row_number
Query result set no serial number depressed problem believe toss a lot of people, often have customers pointing at my grid OR reported to me, "Mo, you can give this place add a serial number?" "For such a reasonable request can only be said to be, and then the results of the query to manually add a serial number, the performance of the sacrifice has to burn the Gaoshan blessing it can ascend to heaven, and then is to bless the customer inquires the amount of data not too big."
Upgrade to SQL2005 I can default the serial number this function to the user do not give me such a reasonable request.
3: The end of the cross-list nightmare
If you have done attendance management, choose to build 31 columns or add 31 lines? Select 31 columns intuitive, but when you query you may prefer to bump your head against the wall rather than to query, add 31 business when you decide to display the date in the column, you find that you still want to bang the wall. And when you're doing a student performance management system, you have to make a list of the class data in the student list, and you suddenly wake up and hit the wall better.
Upgrade to SQL Server2005 you can use pivot the word means "pivot" with axes you can twist rows into columns and twist columns (UNPIVOT)