One of the problems when working with CRM and SQL is when making a complex Select/Query CRM get SQL time out.
The solution is define timeout in register.
1. Open regedit ( start - > write ( regedit) ) and press ok
2. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM
3. Add DWORD name OLEDBTimeout with value 86400 ( 24 hours) select decimal
4. Add DWORD name ExtendedTimeout with value 1000000. The maximum value can be 2,147,483,647 and the default value is 30 seconds
This changes in register should fix the SQL timeout.
Thanks,
Rami Heleg.