Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Query Time out option in OpenRowSet

$
0
0

Team,

     My requirement is to loop through around 100 SSAS Instances and run an MDX query and get response from SQL Server.

     To achive this , I used openrowset solutions

    SET @sqlquery =N'SELECT @LastScanperiod = [[Measures]].[Last Scan Date Internal]]]  
FROM OPENROWSET(''MSOLAP'', ''DATASOURCE=' + @CubeServername +';Initial Catalog=' + @CubeDBName +';Timeout=10''
  ,''SELECT {[Measures].[Last Scan Date Internal]} ON 0 
 FROM [' + @CubeName +']''
)  '
  SET @params = N'@LastScanperiod INT output'; 

   EXEC sp_executesql @sqlquery,@params,@LastScanperiod = @LastScanPeriodKey OUTPUT

   But few of the servers might be down or may take longer time to respond.   I would like to Timeout after a specified period of time instead of waiting until server responds.  Even though I specified Timeout option as 10 sec , still its not working.  Any idea how to solve this?

Thanks,

Prathap


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>