Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Below is the query,i have already used indexing.
SQL
SELECT DISTINCT MASTREL_MASTER AS MasterNo,MASTREL_RELNO AS RelationNo,REL_FULLNAME AS Name
,CONVERT(VARCHAR,REL_DOB,106) AS DateOfBirth,REL_MOTHER AS MotherName,REL_UNIQUEID1 AS PassportNo
,REL_UNIQUEID2 AS DrivingLicenceNo,REL_UNIQUEID3 AS TINNo,REL_UNIQUEID4 AS PhotoIdNo,REL_UNIQUEID5 AS Others
,ADDRESS_ADDRESS AS Address,CONTACT_CONTACT AS Contact,FATHERSPOUSE_FATHER AS FatherName,FATHERSPOUSE_SPOUSE AS SpouseName
FROM t_AspMastRel
LEFT OUTER JOIN t_AspAcc ON t_AspMastRel.MASTREL_MASTER=t_AspAcc.ACC_MASTER
LEFT OUTER JOIN t_AspRel ON t_AspMastRel.MASTREL_RELNO=t_AspRel.REL_RELNO
LEFT OUTER JOIN t_AspContact ON t_AspContact.CONTACT_RELNO=t_AspMastRel.MASTREL_RELNO
LEFT OUTER JOIN t_AspAddress ON t_AspAddress.ADDRESS_RELNO=t_AspMastRel.MASTREL_RELNO
LEFT OUTER JOIN t_AspFatherSpouse ON t_AspFatherSpouse.FATHERSPOUSE_RELNO=t_AspMastRel.MASTREL_RELNO
INNER JOIN (SELECT DISTINCT REL_RELNO AS RELNO FROM t_AspRel WHERE REL_RELNO='********') AS TBL  ON t_AspMastRel.MASTREL_RELNO=TBL.RELNO
WHERE MASTREL_RELNO='********'
Posted
Updated 25-Jan-14 22:53pm
v2
Comments
Kornfeld Eliyahu Peter 26-Jan-14 4:49am    
What do you mean by 'recover'?
Lily Dey 26-Jan-14 4:52am    
successful execution of query without exception.

Read this:
http://www.hosting.com/support/sql/configure-query-timeout-period-in-sql-management-studio/[^]
And this:
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectiontimeout(v=vs.110).aspx[^]

In any case - there is no timeout in SQL server - the error says that your environment didn't get any answer from the SQL server within a specific time. Both articles explain how to set that time period, depending on your environment...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900