Optimize SQL JOIN statements for DataGrid
Posted on 2002-05-21
I'm using VB6 against an SQL Server database.
I'm using an ADO recordset to populate a datagrid control.
I noticed that the grid performs better with different sql select strings.
I need help in writing the best sql select string to populate my grid.
Mostly, on this select from two tables with a common id:
This one performs slow:
"SELECT * FROM Cuts, Appropriations WHERE Cuts.AppropId = Appropriations.Id"
While this string is faster:
Select * from cuts join Appropriations on cuts.appropid = Appropriations.id
Can anyone suggest the best way to write sql statements which draw data from two or more tables?