I have a SQL query that takes about ~10 minutes to complete, the result of this query is being shown on an asp.net webpage.
The problem here is that when I run the query on SQL Server it works fine, but when the query is fired from the web-page, no result is shown on the webpage.
The database size is about ~9 GB, and contains more than 10 million records.
Any solution that would make my webpage wait for the query to be completed and the result being displayed on the page.
The webpage should wait until the response from SQL Server is received - NO termination of connection from SQL Server until the result is received, and the webpage should wait that long.
The Query that is being used is
SELECT
[Ageing_old].[dbo].[base].[Acct Ext Id]
FROM
[Ageing_old].[dbo].[base]
INNER JOIN [Ageing].[dbo].[Base_Adj_Apr_Dec] ON [Ageing_old].[dbo].[base].[Acct Ext Id] = [Ageing].[dbo].[Base_Adj_Apr_Dec].[Billable Ext Id]
INNER JOIN [Ageing].[dbo].[Base_Payment] ON [Ageing_old].[dbo].[base].[Acct Ext Id] = [Ageing].[dbo].[Base_Payment].[BILLED_ID]
INNER JOIN [Ageing].[dbo].[Base_POD] ON [Ageing_old].[dbo].[base].[Acct Ext Id] = [Ageing].[dbo].[Base_POD].[Acct No]
INNER JOIN [Ageing].[dbo].[Billing_Base_1] ON [Ageing_old].[dbo].[base].[Acct Ext Id] = [Ageing].[dbo].[Billing_Base_1].[ext_account_no]
WHERE [Ageing_old].[dbo].[base].[Acct Ext Id] IN (
SELECT Distinct [Ageing].[dbo].[mobile_to_acct].[EXTERNAL_ID]
FROM [Ageing].[dbo].[mobile_to_acct],[Ageing].[dbo].[Devices_Base]
INNER JOIN [Ageing].[dbo].[Final_MNP] ON [Ageing].[dbo].[Devices_Base].[ACCESS_METHOD_IDENTIFIER]= [Ageing].[dbo].[Final_MNP].[MSISDN]
INNER JOIN [Ageing].[dbo].[FTR_Dec] ON [Ageing].[dbo].[Devices_Base].[ACCESS_METHOD_IDENTIFIER]= [Ageing].[dbo].[FTR_Dec].[Sinumber]
INNER JOIN [Ageing].[dbo].[SR_Dec] ON [Ageing].[dbo].[Devices_Base].[ACCESS_METHOD_IDENTIFIER]= [Ageing].[dbo].[SR_Dec].[SI_NUMBER]
)