Last month, I have only one Server (Server A). I installed IIS7 and SQL Server 2005 into this Server. I have a database with 1 table of about 3,000,000 records. I created an ODBC to connect with this table and view data on website by ASP. The speed of data access is OK.

Now, I have new more Server (Server B, configuration is better than A). I installed SQL Server 2008 on B, move all data from A to B. From A, I created ODBC to connect data to B and view data by asp (IIS on A). But data access speed is very slow! I dont know why?

If the databases are identical (i.e., the table structure is the same, they have the same indexes etc.), and assuming the server is "better" than the old server (memory, disk performance, cpu's etc.): Check if you are running maintenance plans on the new server. Index fragmentation and out of date statistics are two things that you can check very easily (google).

Creating appropriate indexes will help speed up the queries. If the original database had no indexes, and if the new one does not, there are factors other than indexes that are affecting performance. Check if you have updated statistics in your database. Does the new server have the same hardware specifications (memory, cpu cores etc.?)

If that is the query that you are most concerned about, and if similar indexes do not already exist, you can create an index on name, birthdate and id. However, creating too many indexes can be detrimental too, so do that only if that is the query that you most want to speed up.

Once you create the index, you should not have to do anything specifically for the query to use it. You can use table hints to specify that a certain index be used, but usually there is no reason to, and usually it is better to leave the query optimizer to its own devices. Run the query before and after the indexes and you should see the difference in performance.